-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.prod.js
34 lines (31 loc) · 878 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
const path = require('path');
const merge = require('webpack-merge');
const webpack = require('webpack');
const ExtractTextPlugin = require('extract-text-webpack-plugin');
const common = require('./webpack.common');
const CLIENT = path.resolve(__dirname, './src/client');
const PUBLIC = path.resolve(__dirname, './public');
module.exports = merge(common, {
entry: {
app: path.join(CLIENT, 'index.js'),
},
output: {
path: PUBLIC,
filename: '[name].bundle.js',
publicPath: '/public',
},
mode:'production',
devtool: 'source-map',
module: {
rules: [{
test: /\.css$/,
use: ExtractTextPlugin.extract({
fallback: "style-loader",
use: "css-loader"
})
}]
},
plugins: [
new ExtractTextPlugin("css/styles.css"),
],
});