mirror of
https://github.com/openharmony/developtools_ace-js2bundle.git
synced 2026-07-21 06:05:27 -04:00
!240 release模式打包改造
Merge pull request !240 from 卡哥/cherry-pick-1652772529
This commit is contained in:
@@ -16,6 +16,7 @@
|
||||
import RawSource from 'webpack-sources/lib/RawSource';
|
||||
|
||||
const path = require('path');
|
||||
const fs = require('fs');
|
||||
const { Compilation } = require('webpack');
|
||||
|
||||
const moduleReg = /(@ohos|@system)(\.[a-zA-Z0-9]+)+/g;
|
||||
@@ -47,8 +48,9 @@ class ModuleCollectionPlugin {
|
||||
}
|
||||
});
|
||||
const moduleCollection = Array.from(moduleList);
|
||||
compilation.assets['./module_collection.txt'] =
|
||||
new RawSource(moduleCollection.length === 0 ? 'NULL' : moduleCollection.join(','));
|
||||
const moduleContent = moduleCollection.length === 0 ? 'NULL' : moduleCollection.join(',');
|
||||
fs.writeFileSync(path.resolve(process.env.buildPath, './module_collection.txt'),
|
||||
moduleContent);
|
||||
back && back();
|
||||
},
|
||||
);
|
||||
|
||||
@@ -210,6 +210,10 @@ function notPreview(env) {
|
||||
}
|
||||
config.plugins.push(new GenAbcPlugin(process.env.buildPath, arkDir, nodeJs,
|
||||
env.buildMode === 'debug'))
|
||||
if (env.buildMode === 'release' && process.env.DEVICE_LEVEL !== 'card') {
|
||||
config.output.path = path.join(process.env.cachePath, "releaseAssets",
|
||||
path.basename(process.env.buildPath));
|
||||
}
|
||||
} else {
|
||||
if (env.deviceType) {
|
||||
let deviceArr = env.deviceType.split(/,/)
|
||||
|
||||
Reference in New Issue
Block a user