-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.js
48 lines (46 loc) · 1.19 KB
/
webpack.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
47
48
var path = require("path");
var webpack = require('webpack');
var node_modules = path.resolve(__dirname, 'node_modules');
var pathToReact = path.resolve(node_modules, 'react/dist/react.js');
var pathToReactDom = path.resolve(node_modules, 'react-dom/dist/react-dom.js');
module.exports = {
context: __dirname + "/app",
resolve: {
alias: {
'react': pathToReact,
'react-dom': pathToReactDom,
'marked': path.resolve(node_modules, 'marked/marked.min.js')
}
},
entry: {
pageA: "./pageA",
statefulComponent: "./statefulComponent.jsx",
TodoApp: "./TodoApp.jsx",
Mark: ['webpack/hot/dev-server',"./mark.js"]
},
output: {
path: path.join(__dirname, "build/app/"),
filename: "[name].bundle.js",
chunkFilename: "[id].chunk.js"
},
module: {
loaders: [{
test: /\.jsx?$/,
exclude: /(node_modules|bower_components)/,
include: [
path.resolve(__dirname, "app/"),
],
noParse: [pathToReact],
query: {
presets: ['react', 'es2015']
},
loader: "babel"
}],
},
plugins: [
new webpack.optimize.CommonsChunkPlugin("commons.js")
],
resolveLoader: {
extensions: ['.jsx', '.js', ]
},
}