<commit_before>const path = require('path')

const defaultOptions = {
  limit: -1,
  fallback: {
    loader: 'file-loader',
    options: {
      publicPath (url, resourcePath, context) {
        if (
          process.env.UNI_PLATFORM === 'app-plus' &&
          process.env.UNI_USING_V3
        ) { // app-plus v3 下路径不能以/开头
          return path.relative(process.env.UNI_INPUT_DIR, resourcePath)
        }
        return '/' + path.relative(process.env.UNI_INPUT_DIR, resourcePath)
      },
      outputPath (url, resourcePath, context) {
        return path.relative(process.env.UNI_INPUT_DIR, resourcePath)
      }
    }
  }
}

const inlineLimit =
  process.env.UNI_PLATFORM === 'mp-weixin' ||
  process.env.UNI_PLATFORM === 'mp-qq' ||
  process.env.UNI_PLATFORM === 'mp-toutiao' ||
  process.env.UNI_PLATFORM === 'app-plus' // v2需要base64,v3需要rewriteUrl

// mp-weixin,mp-qq,app-plus 非v3(即：需要base64的平台)
// 将/static/logo.png转换为~@/static/logo.png
// @import,src,background,background-image

const rewriteUrl = inlineLimit ? require('postcss-urlrewrite')({
  imports: true,
  properties: ['src', 'background', 'background-image'],
  rules: [{<commit_msg>fix(cli): compatible with windows (normalize path)<commit_after>const path = require('path')

const isWin = /^win/.test(process.platform)

const normalizePath = path => (isWin ? path.replace(/\\/g, '/') : path)

const defaultOptions = {
  limit: -1,
  fallback: {
    loader: 'file-loader',
    options: {
      publicPath (url, resourcePath, context) {
        if (
          process.env.UNI_PLATFORM === 'app-plus' &&
          process.env.UNI_USING_V3
        ) { // app-plus v3 下路径不能以/开头
          return normalizePath(path.relative(process.env.UNI_INPUT_DIR, resourcePath))
        }
        return '/' + normalizePath(path.relative(process.env.UNI_INPUT_DIR, resourcePath))
      },
      outputPath (url, resourcePath, context) {
        return normalizePath(path.relative(process.env.UNI_INPUT_DIR, resourcePath))
      }
    }
  }
}

const inlineLimit =
  process.env.UNI_PLATFORM === 'mp-weixin' ||
  process.env.UNI_PLATFORM === 'mp-qq' ||
  process.env.UNI_PLATFORM === 'mp-toutiao' ||
  process.env.UNI_PLATFORM === 'app-plus' // v2需要base64,v3需要rewriteUrl

// mp-weixin,mp-qq,app-plus 非v3(即：需要base64的平台)
// 将/static/logo.png转换为~@/static/logo.png
// @import,src,background,background-image

const rewriteUrl = inlineLimit ? require('postcss-urlrewrite')({
  imports: true,
  properties: ['src', 'background', 'background-image'],
  rules: [{
{'fraction_non_alphanumeric': 0.15522745411013567, 'fraction_numerical': 0.007980845969672785, 'mean_word_length': 3.241962774957699, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, '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': '6259104', 'n_tokens_mistral': 920, 'n_tokens_neox': 918, 'n_words': 136}