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