From 1c51be07ec0bce71d09b04fbc48a950a60b09c89 Mon Sep 17 00:00:00 2001 From: Armand Philippot Date: Sun, 17 Oct 2021 19:42:44 +0200 Subject: 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...) --- webpack.config.js | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 webpack.config.js (limited to 'webpack.config.js') 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); +}; -- cgit v1.2.3