diff options
author | Ivan Dolgov <ivan@dolgov.fi> | 2018-09-22 00:55:11 +0300 |
---|---|---|
committer | Ivan Dolgov <ivan@dolgov.fi> | 2018-09-22 00:55:11 +0300 |
commit | 05b6b72104206468b50743026981e9d3c4974c61 (patch) | |
tree | 176333ebef1b58b82cb4a17a3f7bd571455c4c7f /webpack.config.js | |
parent | e2cf702d339d95600001f60993252b4d8054f6d6 (diff) | |
download | ickui-05b6b72104206468b50743026981e9d3c4974c61.tar.gz |
Configure initial setupivan/setup
Diffstat (limited to 'webpack.config.js')
-rw-r--r-- | webpack.config.js | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/webpack.config.js b/webpack.config.js new file mode 100644 index 0000000..99bbe49 --- /dev/null +++ b/webpack.config.js @@ -0,0 +1,36 @@ +const path = require('path'); +const webpack = require('webpack'); + +module.exports = (env, argv) => { + const commonConf = { + module: { + rules: [ + { + test: /\.js$/, + exclude: /node_modules/, + use: 'babel-loader', + }, { + test: /\.css$/, + use: ['style-loader', 'css-loader'], + }, + ], + }, + }; + + const devConf = { + devServer: { + port: 3000, + contentBase: path.resolve(__dirname, './src'), + hot: true, + stats: 'minimal', + }, + devtool: 'source-map', + plugins: [new webpack.HotModuleReplacementPlugin()], + }; + + if (argv.mode === 'development') { + return { ...commonConf, ...devConf }; + } + + return commonConf; +}; |