forked from ncform/ncform
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request ncform#243 from ncform/develop
Develop
- Loading branch information
Showing
5 changed files
with
54 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 21 additions & 7 deletions
28
packages/ncform-theme-elementui/conf/webpack.config.prd.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,37 @@ | ||
const path = require("path"); | ||
const webpack = require("webpack"); | ||
const merge = require("webpack-merge"); | ||
|
||
const config = require("./config"); | ||
const devConfig = require("./webpack.config.dev"); | ||
|
||
module.exports = { | ||
const commonConfig = { | ||
mode: "production", | ||
|
||
mode: 'production', | ||
|
||
devtool: 'source-map', | ||
devtool: "source-map", | ||
|
||
entry: { | ||
ncformStdComps: path.join(config.src, 'components', 'index.js'), | ||
ncformStdComps: path.join(config.src, "components", "index.js") | ||
}, | ||
|
||
output: { | ||
filename: "[name].min.js", | ||
filename: "[name].min.js" | ||
}, | ||
|
||
optimization: { | ||
minimize: true | ||
} | ||
}; | ||
|
||
module.exports = module.exports = [ | ||
// 非压缩版本 | ||
merge(devConfig[1], commonConfig, { | ||
output: { | ||
filename: "[name].js" | ||
}, | ||
optimization: { | ||
minimize: false | ||
} | ||
}), | ||
// 压缩版本 | ||
merge(devConfig[1], commonConfig) | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,9 @@ | ||
const merge = require('webpack-merge'); | ||
const devConfig = require("./webpack.config.dev"); | ||
const prdConfig = require("./webpack.config.prd"); | ||
|
||
const env = process.env.NODE_ENV; | ||
if (env === "production") { | ||
module.exports = merge(devConfig, prdConfig); | ||
module.exports = prdConfig; | ||
} else { | ||
module.exports = devConfig; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,30 @@ | ||
const path = require("path"); | ||
const webpack = require("webpack"); | ||
const merge = require("webpack-merge"); | ||
const devConfig = require("./webpack.config.dev"); | ||
|
||
const config = require("./config"); | ||
|
||
module.exports = { | ||
|
||
mode: 'production', | ||
const commonConfig = { | ||
mode: "production", | ||
|
||
output: { | ||
filename: "[name].min.js", | ||
filename: "[name].min.js" | ||
}, | ||
|
||
devtool: 'source-map', | ||
devtool: "source-map", | ||
|
||
optimization: { | ||
minimize: true | ||
} | ||
}; | ||
|
||
module.exports = [ | ||
// 非压缩版本 | ||
merge(devConfig, commonConfig, { | ||
output: { | ||
filename: "[name].js" | ||
}, | ||
optimization: { | ||
minimize: false | ||
} | ||
}), | ||
// 压缩版本 | ||
merge(devConfig, commonConfig) | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters