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

feat(automator): add json config

上级 88274d1b
...@@ -198,6 +198,20 @@ module.exports = function configureWebpack (platformOptions, manifestPlatformOpt ...@@ -198,6 +198,20 @@ module.exports = function configureWebpack (platformOptions, manifestPlatformOpt
plugins.push(new CopyWebpackPlugin(getCopyWebpackPluginOptions(manifestPlatformOptions, vueOptions))) plugins.push(new CopyWebpackPlugin(getCopyWebpackPluginOptions(manifestPlatformOptions, vueOptions)))
} }
plugins.push(new CopyWebpackPlugin([{
from: require.resolve('@dcloudio/uni-automator/dist/automator.json'),
to: '../.automator/' + (process.env.UNI_SUB_PLATFORM || process.env.UNI_PLATFORM) +
'/.automator.json',
transform (content) {
if (process.env.UNI_AUTOMATOR_WS_ENDPOINT) {
return JSON.stringify({
wsEndpoint: process.env.UNI_AUTOMATOR_WS_ENDPOINT
})
}
return ''
}
}]))
if (process.UNI_SCRIPT_ENV && Object.keys(process.UNI_SCRIPT_ENV).length) { if (process.UNI_SCRIPT_ENV && Object.keys(process.UNI_SCRIPT_ENV).length) {
// custom define // custom define
const envs = Object.create(null) const envs = Object.create(null)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册