-
Notifications
You must be signed in to change notification settings - Fork 12
/
webpack.config.dev.js
66 lines (61 loc) · 1.68 KB
/
webpack.config.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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
var webpack = require('webpack');
var path = require('path');
var Promise = require('es6-promise').polyfill();
var AssetsPlugin = require('assets-webpack-plugin');
var entryPointList = require(__dirname + '/entryPoints.js');
//var APP_DIR = path.resolve(__dirname, '');
var JS_DIR = path.resolve(__dirname, 'javascript');
module.exports = {
devtool: 'eval',
entry: entryPointList.entryPoints,
output: {
path: path.join(JS_DIR, "dist"),
filename: "[name].dev.js",
publicPath: "javascript/dist/"
},
externals: {
"jquery": "$"
},
module: {
rules: [
{
enforce: "pre",
test: /\.(js|jsx)$/,
use: [
{
loader: "eslint-loader",
options: {configFile: path.join(__dirname, '.eslintrc.js'),
useEslintrc: false}
}
],
include: JS_DIR
}, {
test: /\.(js|jsx)$/,
include: JS_DIR,
use: [
{
loader: 'babel-loader',
query: {presets: ['env', 'react']}
}
]
}, {
test: /\.css$/,
use: [
{
loader: "style-loader"
},
{
loader: "css-loader"
}
]
}]
},
plugins: [
new AssetsPlugin({
filename: 'assets.json',
prettyPrint: true
}),
//new webpack.optimize.CommonsChunkPlugin("vendor", "vendor.bundle.js")
new webpack.optimize.CommonsChunkPlugin({ name: 'vendor', filename: 'vendor.bundle.js' })
]
}