mirror of
https://github.com/openharmony/developtools_ace-js2bundle.git
synced 2026-07-21 06:05:27 -04:00
@@ -13,12 +13,12 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import RawSource from 'webpack-sources/lib/RawSource';
|
||||
|
||||
const path = require('path');
|
||||
const fs = require('fs');
|
||||
const { Compilation } = require('webpack');
|
||||
|
||||
import { mkDir } from './util';
|
||||
|
||||
const moduleReg = /(@ohos|@system)(\.[a-zA-Z0-9]+)+/g;
|
||||
|
||||
class ModuleCollectionPlugin {
|
||||
@@ -49,6 +49,9 @@ class ModuleCollectionPlugin {
|
||||
});
|
||||
const moduleCollection = Array.from(moduleList);
|
||||
const moduleContent = moduleCollection.length === 0 ? 'NULL' : moduleCollection.join(',');
|
||||
if (!fs.existsSync(process.env.buildPath)) {
|
||||
mkDir(process.env.buildPath);
|
||||
}
|
||||
fs.writeFileSync(path.resolve(process.env.buildPath, './module_collection.txt'),
|
||||
moduleContent);
|
||||
back && back();
|
||||
@@ -58,4 +61,4 @@ class ModuleCollectionPlugin {
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = ModuleCollectionPlugin;
|
||||
module.exports = ModuleCollectionPlugin;
|
||||
Reference in New Issue
Block a user