-
Notifications
You must be signed in to change notification settings - Fork 2
/
webpack.config.babel.js
44 lines (31 loc) · 930 Bytes
/
webpack.config.babel.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
import path from "path";
import webpack from "webpack";
let entry;
let plugins;
entry = "./index.js";
plugins = [
new webpack.optimize.OccurenceOrderPlugin(),
// new webpack.HotModuleReplacementPlugin(),
new webpack.NoErrorsPlugin(),
new webpack.BannerPlugin('require("source-map-support").install();', { raw: true, entryOnly: false }),
new webpack.BannerPlugin('require("babel-polyfill");', { raw: true, entryOnly: true }),
new webpack.BannerPlugin("#!/usr/bin/env node\n", { raw: true, entryOnly: true }),
];
module.exports = {
devtool: "source-map",
target: "node",
context: path.join(__dirname, "src"),
entry,
output: {
libraryTarget: "commonjs",
path: path.join(__dirname, "lib"),
filename: "index.js",
},
module: {
loaders: [
{ test: /\.js$/, include: path.join(__dirname, "src"), loaders: ["babel"] },
],
},
externals: [/^[a-z\-0-9]+$/],
plugins,
};