const path = require('path') const parser = require('@babel/parser') const { removeExt, hyphenate, normalizePath, getComponentName, jsPreprocessOptions } = require('@dcloudio/uni-cli-shared') const { updateUsingComponents } = require('@dcloudio/uni-cli-shared/lib/cache') const preprocessor = require('@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader/preprocess') const traverse = require('./babel/scoped-component-traverse') const { resolve, normalizeNodeModules } = require('./shared') const { findBabelLoader, addDynamicImport } = require('./babel/util') module.exports = function (content, map) { this.cacheable && this.cacheable() content = preprocessor.preprocess(content, jsPreprocessOptions.context, { type: jsPreprocessOptions.type }) let resourcePath = normalizeNodeModules(removeExt(normalizePath(path.relative(process.env.UNI_INPUT_DIR, this .resourcePath)))) let type = '' if (resourcePath === 'App') { type = 'App' } else if (process.UNI_ENTRY[resourcePath]) { type = 'Page' } //