How to use the @dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader/preprocess.preprocess function in @dcloudio/vue-cli-plugin-uni

To help you get started, we’ve selected a few @dcloudio/vue-cli-plugin-uni examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github dcloudio / uni-app / packages / uni-cli-shared / lib / json.js View on Github external
function parseJson (content, preprocess = false) {
  if (typeof content === 'string') {
    if (preprocess) {
      const preprocessor = require('@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader/preprocess')
      const {
        jsPreprocessOptions
      } = require('./platform')
      content = preprocessor.preprocess(content, jsPreprocessOptions.context, {
        type: jsPreprocessOptions.type
      })
    }
    content = JSON.parse(stripJsonComments(content))
  }

  content = JSON.stringify(content)
    .replace(/\u2028/g, '\\u2028')
    .replace(/\u2029/g, '\\u2029')

  return JSON.parse(content)
}
github dcloudio / uni-app / packages / vue-cli-plugin-uni / packages / webpack-uni-app-loader / view / script.js View on Github external
module.exports = function(content, map) {
  this.cacheable && this.cacheable()

  content = preprocessor.preprocess(content, jsPreprocessOptions.context, {
    type: jsPreprocessOptions.type
  })

  return genCode(parseComponents(content, traverse))
}

@dcloudio/vue-cli-plugin-uni

uni-app plugin for vue-cli 3

Apache-2.0
Latest version published 3 months ago

Package Health Score

74 / 100
Full package analysis

Similar packages