diff options
Diffstat (limited to 'webpack.config.js')
-rw-r--r-- | webpack.config.js | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/webpack.config.js b/webpack.config.js new file mode 100644 index 0000000..bca6800 --- /dev/null +++ b/webpack.config.js @@ -0,0 +1,33 @@ +const HtmlWebpackPlugin = require('html-webpack-plugin'); +const MiniCssExtractPlugin = require('mini-css-extract-plugin'); +const path = require('path'); + +module.exports = { + entry: './src/js/main.js', + output: { + path: __dirname + '/dist', + filename: 'bundle.js' + }, + module: { + rules: [ + { + test: /\.css$/i, + use: [MiniCssExtractPlugin.loader, 'css-loader'] + }, + { + test: /\.html$/i, + loader: 'raw-loader' + } + ] + }, + plugins: [ + new MiniCssExtractPlugin({ + filename: 'style.css' + }), + new HtmlWebpackPlugin({ + hash: true, + template: __dirname + '/src/index.html', + filename: 'index.html' + }) + ] +}; |