-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.dev.config.js
46 lines (43 loc) · 957 Bytes
/
webpack.dev.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
42
43
44
45
46
import webpack from 'webpack';
import fs from 'fs';
import path from 'path';
import { host, port } from './src/config';
const assetsPath = path.resolve(__dirname, './static/dist');
const babelrc = fs.readFileSync('.babelrc');
const babelLoaderQuery = JSON.parse(babelrc);
const devPort = (Number(port) + 1);
export default {
devtool: 'source-map',
entry: {
main: [
'babel-polyfill',
'./src/client.js',
],
},
output: {
path: assetsPath,
filename: '[name].js',
chunkFilename: '[name]-[chunkhash].js',
publicPath: `http://${host}:${devPort}/dist/`,
},
module: {
loaders: [
{
test: /\.jsx?$/, exclude: /node_modules/,
loaders: [
`babel?${JSON.stringify(babelLoaderQuery)}`,
'eslint-loader',
],
},
],
},
resolve: {
modulesDirectories: [
'src',
'node_modules',
],
},
plugins: [
new webpack.NoErrorsPlugin(),
],
};