const path = require('path') const parser = require('@babel/parser') const { removeExt, hyphenate, normalizePath, getComponentName, jsPreprocessOptions } = require('@dcloudio/uni-cli-shared') const { getBabelParserOptions } = require('@dcloudio/uni-cli-shared/lib/platform') const { isBuiltInComponentPath } = require('@dcloudio/uni-cli-shared/lib/pages') 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, getIssuer } = require('./shared') const { findBabelLoader, addDynamicImport } = require('./babel/util') const uniI18n = require('@dcloudio/uni-cli-i18n') 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' } //