-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathwebpack.dev.js
41 lines (35 loc) · 973 Bytes
/
webpack.dev.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
/* global require module */
const sourceDir = 'src/client';
const WebpackMerge = require('webpack-merge');
const CopyWebpackPlugin = require('copy-webpack-plugin');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const commonConfig = require('./webpack.common.js');
const packageDetails = require('./package.json');
const copy = new CopyWebpackPlugin([
{
from: `${sourceDir}/manifest.json`,
transform: (content, path) =>
content.toString()
.replace(/#manifest-origin#/g, '/')
}
]);
const html = new HtmlWebpackPlugin({
template: `${sourceDir}/index.ejs`,
templateParameters: {
titlePrefix: '[DEBUG] ',
baseUrl: '/',
version: packageDetails.version
},
filename: 'index.html',
chunks: ['app']
});
module.exports = WebpackMerge(
commonConfig,
{
devtool: 'inline-source-map',
plugins: [
copy,
html
]
}
);