-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.js
49 lines (47 loc) · 1.15 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
let config =
require("@terse/webpack")
.api()
.entry({
index: "./src/index.js",
example: "./src/example.js"
})
.loader(
'babel-loader'
, '.js'
, {
exclude: /node_modules/
, query: {
cacheDirectory: true
, presets: ['stage-0']
, env: {
production: {
presets: ["babili"]
}
}
}
})
.plugin("webpack.NamedModulesPlugin")
.plugin("optimize-js-plugin")
.plugin("webpack.NoErrorsPlugin")
.sourcemap("source-map")
.externals(/^@?\w[a-z\-0-9\./]+$/)
.output({
path:'./build'
, library: 'graphdl'
, libraryTarget: 'commonjs2'
})
.target("async-node")
.when("development", api =>
api
.entry({
index: [
"webpack/hot/poll?500"
, "./src/index.js"
],
example: './src/example.js'
})
.plugin("webpack.HotModuleReplacementPlugin")
.plugin('start-server-webpack-plugin', 'example.js'))
.getConfig()
delete config.module.preLoaders
module.exports = config