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

chore(cli): ignore automator when subpackage

上级 cd806d8a
......@@ -197,24 +197,25 @@ module.exports = function configureWebpack (platformOptions, manifestPlatformOpt
if (!isAppView) { // app-plus view不需要copy
plugins.push(new CopyWebpackPlugin(getCopyWebpackPluginOptions(manifestPlatformOptions, vueOptions)))
}
try {
const automatorJson = require.resolve('@dcloudio/uni-automator/dist/automator.json')
plugins.push(new CopyWebpackPlugin([{
from: automatorJson,
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({
version: require('@dcloudio/uni-automator/package.json').version,
wsEndpoint: process.env.UNI_AUTOMATOR_WS_ENDPOINT
})
if (!process.env.UNI_SUBPACKGE) {
try {
const automatorJson = require.resolve('@dcloudio/uni-automator/dist/automator.json')
plugins.push(new CopyWebpackPlugin([{
from: automatorJson,
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({
version: require('@dcloudio/uni-automator/package.json').version,
wsEndpoint: process.env.UNI_AUTOMATOR_WS_ENDPOINT
})
}
return ''
}
return ''
}
}]))
} catch (e) {}
}]))
} catch (e) {}
}
if (process.UNI_SCRIPT_ENV && Object.keys(process.UNI_SCRIPT_ENV).length) {
// custom define
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册