forked from alex7kom/nano-nanoid-cc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.js
41 lines (37 loc) · 1.06 KB
/
webpack.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
'use strict';
/* eslint-env node */
var path = require('path');
var HtmlWebpackPlugin = require('html-webpack-plugin');
var ScriptExtHtmlWebpackPlugin = require('script-ext-html-webpack-plugin');
var StyleExtHtmlWebpackPlugin = require('style-ext-html-webpack-plugin');
var CopyWebpackPlugin = require('copy-webpack-plugin');
var UglifyJsPlugin = require('uglifyjs-webpack-plugin');
var MiniCssExtractPlugin = require('mini-css-extract-plugin');
module.exports = {
mode: 'production',
module: {
rules: [
{
test: /\.css$/i,
use: [MiniCssExtractPlugin.loader, 'css-loader', 'postcss-loader']
}
]
},
entry: './src/index.js',
output: {
path: path.join(__dirname, 'dist'),
filename: 'bundle.js'
},
plugins: [
new UglifyJsPlugin(),
new MiniCssExtractPlugin(),
new HtmlWebpackPlugin({
template: './src/index.html'
}),
new ScriptExtHtmlWebpackPlugin({
inline: ['bundle.js']
}),
new StyleExtHtmlWebpackPlugin(),
new CopyWebpackPlugin([{ from: './src/favicon.ico', to: './' }])
]
};