mirror of
https://github.com/openharmony/developtools_ace-js2bundle.git
synced 2026-07-20 21:59:23 -04:00
!41 support import js in project
Merge pull request !41 from wangchun17/0914ace
This commit is contained in:
@@ -107,9 +107,6 @@ const webpackConfig = {
|
||||
node: {
|
||||
global: false,
|
||||
},
|
||||
resolve: {
|
||||
modules: [path.join(__dirname, 'node_modules'), './node_modules'],
|
||||
},
|
||||
stats: 'none',
|
||||
};
|
||||
|
||||
@@ -146,7 +143,14 @@ module.exports = (env) => {
|
||||
}),
|
||||
new ReturnExportsPlugin(),
|
||||
]
|
||||
|
||||
webpackConfig.resolve = {
|
||||
modules: [
|
||||
process.env.projectPath,
|
||||
path.join(process.env.projectPath, '../../../../../'),
|
||||
path.join(__dirname, 'node_modules'),
|
||||
'./node_modules'
|
||||
]
|
||||
}
|
||||
if (fs.existsSync(path.resolve(process.env.projectPath, 'i18n'))) {
|
||||
webpackConfig.plugins.push(new CopyPlugin({
|
||||
patterns: [
|
||||
|
||||
@@ -140,9 +140,6 @@ let config = {
|
||||
node: {
|
||||
global: false
|
||||
},
|
||||
resolve: {
|
||||
modules: [path.join(__dirname, 'node_modules'), './node_modules']
|
||||
},
|
||||
stats: 'none'
|
||||
}
|
||||
|
||||
@@ -191,6 +188,14 @@ module.exports = (env) => {
|
||||
build: process.env.buildPath
|
||||
})
|
||||
]
|
||||
config.resolve = {
|
||||
modules: [
|
||||
process.env.projectPath,
|
||||
path.join(process.env.projectPath, '../../../../../'),
|
||||
path.join(__dirname, 'node_modules'),
|
||||
'./node_modules'
|
||||
]
|
||||
}
|
||||
if (fs.existsSync(path.resolve(process.env.projectPath, 'i18n'))) {
|
||||
config.plugins.push(new CopyPlugin({
|
||||
patterns: [
|
||||
@@ -237,9 +242,7 @@ module.exports = (env) => {
|
||||
compress: {
|
||||
unused: true
|
||||
},
|
||||
sourceMap: {
|
||||
content: sourceMap
|
||||
}
|
||||
sourceMap: true
|
||||
};
|
||||
if (process.env.DEVICE_LEVEL === 'rich' && /\/workers\//.test(Object.keys(file)[0])) {
|
||||
uglifyEsOptions.compress.unused = false;
|
||||
|
||||
Reference in New Issue
Block a user