<commit_before>const
  ExtractTextPlugin = require('extract-text-webpack-plugin'),
  fs = require('fs'),
  appPaths = require('./app-paths'),
  postCssFile = appPaths.resolve.app('.postcssrc.js'),
  warn = require('../helpers/logger')('css-utils', 'red')

if (!fs.existsSync(postCssFile)) {
  warn('Missing /.postcssrc.js file...')
  warn()
  process.exit(1)
}

const postCss = require(postCssFile)

postCss.plugins = postCss.plugins || []

if (!Array.isArray(postCss.plugins)) {
  console.log(`Your newer Quasar CLI requires a minor change to /.postcssrc.js.
"plugins" property needs to be converted into an Array.

Example:

// before
plugins: {
  autoprefixer: {}
}

// change to:
plugins: [
  require('autoprefixer')
]
`)
  process.exit(1)
}

module.exports.postCSSrc = postCss

module.exports.cssLoaders = function (options = {}) {
  const cssLoader = {
    loader: 'css-loader',
    options: {
      // only minimize if necessary
      // (if extract and minimize then dedupe plugin does minimization)
      minimize: options.extract && options.minimize
        ? false
        : options.minimize,
      sourceMap: options.sourceMap
    }
  }

  const postcssLoader = {
    loader: 'postcss-loader',
    options: {
      sourceMap: options.sourceMap
    }
  }

  if (options.rtl) {
    postcssLoader.options.plugins = () => {
      return postCss.plugins.concat([
        require('postcss-rtl')({
          onlyDirection: 'rtl'
        })
      ])
    }
  }

  // generate loader string to be used with extract text plugin
  function generateLoaders (loader, loaderOptions) {
    const loaders = options.postCSS ? [cssLoader, postcssLoader] : [cssLoader]

    if (loader) {<commit_msg>feat: Further RTL work<commit_after>const
  ExtractTextPlugin = require('extract-text-webpack-plugin'),
  fs = require('fs'),
  appPaths = require('./app-paths'),
  postCssFile = appPaths.resolve.app('.postcssrc.js'),
  warn = require('../helpers/logger')('css-utils', 'red')

if (!fs.existsSync(postCssFile)) {
  warn('Missing /.postcssrc.js file...')
  warn()
  process.exit(1)
}

const postCss = require(postCssFile)

postCss.plugins = postCss.plugins || []

if (!Array.isArray(postCss.plugins)) {
  console.log(`Your newer Quasar CLI requires a minor change to /.postcssrc.js.
"plugins" property needs to be converted into an Array.

Example:

// before
plugins: {
  autoprefixer: {}
}

// change to:
plugins: [
  require('autoprefixer')
]
`)
  process.exit(1)
}

module.exports.postCSSrc = postCss

module.exports.cssLoaders = function (options = {}) {
  const cssLoader = {
    loader: 'css-loader',
    options: {
      // only minimize if necessary
      // (if extract and minimize then dedupe plugin does minimization)
      minimize: options.extract && options.minimize
        ? false
        : options.minimize,
      sourceMap: options.sourceMap
    }
  }

  const postcssLoader = {
    loader: 'postcss-loader',
    options: {
      sourceMap: options.sourceMap
    }
  }

  if (options.rtl) {
    const rtlOptions = options.rtl === true
      ? { onlyDirection: 'rtl' }
      : options.rtl

    postcssLoader.options.plugins = () => {
      return [
        require('postcss-rtl')(rtlOptions)
      ]
    }
  }

  // generate loader string to be used with extract text plugin
  function generateLoaders (loader, loaderOptions) {
    const loaders = options.postCSS ? [cssLoader, postcssLoader] : [cssLoader]

    if (loader) {
{'fraction_non_alphanumeric': 0.13719778619283426, 'fraction_numerical': 0.0011651616661811825, 'mean_word_length': 3.073546856465006, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2102746', 'n_tokens_mistral': 1116, 'n_tokens_neox': 1100, 'n_words': 249}