conditional compilation through DefinePlugin

Signed-off-by: houhaoyu <houhaoyu@huawei.com>
Change-Id: I1647b956083e41aac1ed1356a1b4b80785ddb036
This commit is contained in:
houhaoyu
2022-02-08 19:54:43 +08:00
parent f85bd915ec
commit 49c6175ed4
2 changed files with 9 additions and 0 deletions
+4
View File
@@ -145,6 +145,10 @@ module.exports = (env) => {
build: process.env.buildPath
}),
new ReturnExportsPlugin(),
new webpack.DefinePlugin({
STANDARD: JSON.stringify(false),
LITE: JSON.stringify(true)
})
]
webpackConfig.resolve = {
modules: [
+5
View File
@@ -27,6 +27,7 @@ const { PLATFORM }= require('./lib/lite/lite-enum')
const util = require('./lib/util')
const TerserPlugin = require('terser-webpack-plugin')
const CopyPlugin = require("copy-webpack-plugin")
const webpack = require('webpack')
let watchMode = (process.env.watchMode && process.env.watchMode === 'true') || false
const {
deleteFolderRecursive,
@@ -254,6 +255,10 @@ module.exports = (env) => {
new ResourcePlugin(process.env.projectPath, process.env.buildPath, process.env.aceManifestPath),
new ResultStates({
build: process.env.buildPath
}),
new webpack.DefinePlugin({
STANDARD: JSON.stringify(true),
LITE: JSON.stringify(false)
})
]
config.resolve = {