提交 e8745e0d 编写于 作者: fxy060608's avatar fxy060608

fix(cli): transpileDependencies https://ask.dcloud.net.cn/question/90068

上级 14f68616
......@@ -52,7 +52,7 @@ module.exports = (api, options) => {
Object.assign(options, { // TODO 考虑非 HBuilderX 运行时,可以支持自定义输出目录
outputDir: process.env.UNI_OUTPUT_TMP_DIR || process.env.UNI_OUTPUT_DIR,
assetsDir
}, vueConfig)
}, vueConfig) // 注意,此处目前是覆盖关系,后续考虑改为webpack merge逻辑
require('./lib/options')(options)
......
......@@ -52,11 +52,7 @@ function getProvides (isAppService) {
const v3 = {
vueConfig: {
parallel: false,
transpileDependencies: [
wxsPath,
runtimePath
]
parallel: false
},
webpackConfig (webpackConfig, vueOptions, api) {
const isAppService = !!vueOptions.pluginOptions['uni-app-plus']['service']
......
......@@ -62,10 +62,6 @@ if (process.env.NODE_ENV !== 'production') {
const vueConfig = {
parallel: false, // 因为传入了自定义 compiler,避免参数丢失,禁用parallel
publicPath,
transpileDependencies: [
wxsPath,
runtimePath
],
pages: {
index: {
// page 的入口
......
......@@ -19,6 +19,10 @@ module.exports = function initOptions (options) {
options.transpileDependencies.push(path.resolve(process.env.UNI_INPUT_DIR, 'node_modules'))
options.transpileDependencies.push('@dcloudio/uni-' + process.env.UNI_PLATFORM)
options.transpileDependencies.push('@dcloudio/uni-stat')
// mp runtime
options.transpileDependencies.push('@dcloudio/uni-mp-weixin/dist/mp.js')
// wxs
options.transpileDependencies.push('@dcloudio/uni-mp-weixin/dist/wxs.js')
if (process.env.UNI_PLATFORM === 'app-plus') {
options.transpileDependencies.push('format-log.js')
......@@ -64,12 +68,12 @@ module.exports = function initOptions (options) {
sassData = `${sassData}
@import "@/uni.scss";`
}
if (!options.css.loaderOptions.sass.sassOptions) {
options.css.loaderOptions.sass.sassOptions = {}
}
if (!options.css.loaderOptions.sass.sassOptions) {
options.css.loaderOptions.sass.sassOptions = {}
}
// 指定 outputStyle, 否则 production 模式下会被默认成 compressed
options.css.loaderOptions.sass.sassOptions.outputStyle = 'nested'
options.css.loaderOptions.sass.sassOptions.outputStyle = 'nested'
if (sassLoaderVersion < 8) {
options.css.loaderOptions.sass.data = sassData
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册