generated from colomfernando/base-react-styled
-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.prod.js
46 lines (45 loc) · 982 Bytes
/
webpack.prod.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
42
43
44
45
46
const path = require('path');
const { CleanWebpackPlugin } = require('clean-webpack-plugin');
const HtmlWebpackPlugin = require('html-webpack-plugin');
module.exports = {
entry: {
app: ['./js/index.js']
},
mode: 'production',
resolve: {
extensions: ['.js', '.jsx'],
modules: [path.resolve(__dirname, 'src'), 'node_modules'],
alias: {
js: path.resolve('src/js'),
components: path.resolve('src/js/components'),
theme: path.resolve('src/js/theme'),
core: path.resolve('src/js/core')
}
},
module: {
rules: [
{
test: /\.js$/,
exclude: /node_modules/,
use: ['babel-loader']
},
{
test: /\.jsx?$/,
exclude: /node_modules/,
loader: 'babel-loader'
}
]
},
plugins: [
new CleanWebpackPlugin(),
new HtmlWebpackPlugin({
template: 'html/index.html',
filename: 'index.html'
})
],
output: {
filename: '[name].bundle.js',
path: path.resolve(__dirname, './build')
},
context: path.resolve(__dirname, 'src')
};