diff --git a/BUILD.gn b/BUILD.gn index 1809939..cfdb952 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -198,8 +198,10 @@ ohos_copy("ets_loader_declaration") { ohos_copy("ets_loader_ark") { deps = [ ":build_ets_loader_library" ] sources = ets_loader_sources - deps += [ ":build_ets_sysResource" ] - sources += [ ets_sysResource ] + if (!is_standard_system) { + deps += [ ":build_ets_sysResource" ] + sources += [ ets_sysResource ] + } outputs = [ target_out_dir + "/$target_name/{{source_file_part}}" ] } @@ -221,6 +223,15 @@ ohos_copy("ets_loader_ark_declaration") { outputs = [ target_out_dir + "/ets_loader_ark/declarations" ] } +ohos_copy("ets_loader_ark_syntax") { + deps = [ + ":build_ets_loader_library", + ":ets_loader_ark", + ] + sources = [ ets_loader_syntax_dir ] + outputs = [ target_out_dir + "/ets_loader_ark/syntax_parser/dist" ] +} + ohos_copy("ets_loader_ark_components") { deps = [ ":build_ets_loader_library", @@ -239,15 +250,6 @@ ohos_copy("ets_loader_ark_server") { outputs = [ target_out_dir + "/ets_loader_ark/server" ] } -ohos_copy("ets_loader_ark_syntax") { - deps = [ - ":build_ets_loader_library", - ":ets_loader_ark", - ] - sources = [ ets_loader_syntax_dir ] - outputs = [ target_out_dir + "/ets_loader_ark/syntax_parser/dist" ] -} - ohos_copy("ets_loader_node_modules") { deps = [ ":ets_loader_ark", diff --git a/compiler/src/gen_abc_plugin.ts b/compiler/src/gen_abc_plugin.ts index 3382d9d..4a30556 100644 --- a/compiler/src/gen_abc_plugin.ts +++ b/compiler/src/gen_abc_plugin.ts @@ -22,7 +22,6 @@ import { logger } from './compile_info'; const firstFileEXT: string = '_.js'; let output: string; -let webpackPath: string; let isWin: boolean = false; let isMac: boolean = false; let isDebug: boolean = false; @@ -30,7 +29,6 @@ let arkDir: string; let nodeJs: string; const red: string = '\u001b[31m'; -const blue: string = '\u001b[34m'; const reset: string = '\u001b[39m'; export class GenAbcPlugin { diff --git a/compiler/webpack.config.js b/compiler/webpack.config.js index 7d464de..d8da28c 100644 --- a/compiler/webpack.config.js +++ b/compiler/webpack.config.js @@ -111,7 +111,7 @@ function initConfig(config) { global: false }, resolve: { - extensions:['.js', '.ets', '.ts'], + extensions: ['.js', '.ets', '.ts'], modules: [ projectPath, path.join(projectPath, '../../../../../'), @@ -125,11 +125,12 @@ function initConfig(config) { paths: [ /\.js$/, /\.d\.ts$/ - ]}), + ] + }), new CleanWebpackPlugin(), new ResultStates() ] - }) + }); } function setProjectConfig(envArgs) { @@ -150,14 +151,14 @@ function setProjectConfig(envArgs) { function setReleaseConfig(config) { const TerserPlugin = require('terser-webpack-plugin'); - config.mode = 'production'; - config.optimization = { - emitOnErrors: true, - usedExports: false, - minimize: true, - minimizer: [ new TerserPlugin() ] - }; - config.output.sourceMapFilename = '_releaseMap/[name].js.map'; + config.mode = 'production'; + config.optimization = { + emitOnErrors: true, + usedExports: false, + minimize: true, + minimizer: [new TerserPlugin()] + }; + config.output.sourceMapFilename = '_releaseMap/[name].js.map'; } function setCopyPluginConfig(config) { @@ -217,7 +218,7 @@ module.exports = (env, argv) => { } let nodeJs = 'node'; if (env.nodeJs) { - nodeJs = env.nodeJs + nodeJs = env.nodeJs; } config.plugins.push(new GenAbcPlugin(projectConfig.buildPath, arkDir, nodeJs, env.buildMode === 'debug'));