-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathwebpack.dev.js
More file actions
34 lines (31 loc) · 925 Bytes
/
webpack.dev.js
File metadata and controls
34 lines (31 loc) · 925 Bytes
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 CopyWebpackPlugin = require('copy-webpack-plugin')
const path = require('path');
const merge = require('webpack-merge');
const common = require('./webpack.common.js');
const port = process.env.PORT || 3000;
const distPath = path.join(__dirname, 'dist');
const devAssetsPath = path.join(__dirname, 'dev', 'assets');
module.exports = merge(common, {
devServer: {
port: port,
historyApiFallback: true,
contentBase: path.resolve(distPath)
},
devtool: 'inline-source-map',
plugins: [
new CopyWebpackPlugin([ {
from: path.resolve(path.join(devAssetsPath, 'conf.js')),
to: path.resolve(path.join(distPath, 'conf'))
},
{
from: path.resolve(path.join(devAssetsPath, '*.json')),
to: path.resolve(distPath),
flatten: true
},
{
from: path.resolve(path.join(devAssetsPath, '*.md')),
to: path.resolve(distPath),
flatten: true
}])
]
});