forked from nteract/nteract
-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.js
65 lines (61 loc) · 1.51 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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
const LodashModuleReplacementPlugin = require("lodash-webpack-plugin");
const webpack = require("webpack");
const path = require("path");
const nodeModules = {
zmq: "commonjs zmq",
jmp: "commonjs jmp",
github: "commonjs github",
canvas: "commonjs canvas"
};
module.exports = {
entry: {
app: "./src/notebook/index.js",
vendor: [
"react",
"react-dnd",
"react-dnd-html5-backend",
"react-dom",
"react-redux",
"react-simple-dropdown",
"redux",
"redux-logger",
"redux-observable",
"immutable",
"rxjs",
"codemirror",
"commonmark",
"commonmark-react-renderer",
"date-fns"
]
},
target: "electron-renderer",
output: {
path: path.join(__dirname, "lib"),
filename: "webpacked-notebook.js"
},
module: {
rules: [
{ test: /\.js$/, exclude: /node_modules/, loader: "babel-loader" },
{ test: /\.json$/, loader: "json-loader" }
]
},
resolve: {
mainFields: ["nteractDesktop", "main"],
extensions: [".js", ".jsx"]
},
externals: nodeModules,
plugins: [
new LodashModuleReplacementPlugin(),
new webpack.optimize.ModuleConcatenationPlugin(),
new webpack.IgnorePlugin(/\.(css|less)$/),
// build vendor bundle (including common code chunks used in other bundles)
new webpack.optimize.CommonsChunkPlugin({
name: "vendor",
filename: "vendor.js"
}),
new webpack.SourceMapDevToolPlugin({
filename: "[name].js.map",
exclude: ["vendor.js"]
})
]
};