diff options
| author | Armand Philippot <git@armandphilippot.com> | 2021-10-17 19:42:44 +0200 |
|---|---|---|
| committer | Armand Philippot <git@armandphilippot.com> | 2021-10-17 19:42:44 +0200 |
| commit | 1c51be07ec0bce71d09b04fbc48a950a60b09c89 (patch) | |
| tree | da99d11b0523cf6fa7401859aac129ef53ec4da4 /webpack.config.js | |
| parent | 22adbcd1eb5f4233f65cc4f195298c32cfaa156e (diff) | |
build: add webpack config
Downgrade Imagemin-SVGO to v9 because v10 is incompatible with image
minimizer.
Change ESlint config to avoid lint error (should be dependency instead
of devDependency...)
Diffstat (limited to 'webpack.config.js')
| -rw-r--r-- | webpack.config.js | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/webpack.config.js b/webpack.config.js new file mode 100644 index 0000000..44379a1 --- /dev/null +++ b/webpack.config.js @@ -0,0 +1,11 @@ +const { merge } = require("webpack-merge"); +const common = require("./config/webpack.common"); +const dev = require("./config/webpack.dev"); +const prod = require("./config/webpack.prod"); + +const isProduction = process.env.NODE_ENV === "production"; + +module.exports = () => { + if (isProduction) return merge(common, prod); + return merge(common, dev); +}; |
