diff --git a/template/build/webpack.base.conf.js b/template/build/webpack.base.conf.js index ca47401..265283b 100644 --- a/template/build/webpack.base.conf.js +++ b/template/build/webpack.base.conf.js @@ -147,7 +147,14 @@ if (/^(swan)|(tt)$/.test(PLATFORM)) { plugins: [ new CopyWebpackPlugin([{ from: path.resolve(__dirname, projectConfigMap[PLATFORM]), - to: path.resolve(config.build.assetsRoot) + to: path.resolve(config.build.assetsRoot), + transform: (content) => { + const config = JSON.parse(content) + if (config.miniprogramRoot) { + config.miniprogramRoot = './' + } + return JSON.stringify(config, null, 2) + }, }]) ] })