-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.js
55 lines (44 loc) · 1.88 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
import Path from "path";
import Webpack from "webpack";
// CONFIG ==========================================================================================
export default {
// Compilation target: http://webpack.github.io/docs/configuration.html#target
target: "node",
// Entry files: http://webpack.github.io/docs/configuration.html#entry
entry: {
index: "./src/index",
},
// Output files: http://webpack.github.io/docs/configuration.html#output
output: {
// Abs. path to output directory: http://webpack.github.io/docs/configuration.html#output-path
path: Path.resolve("."),
// Filename of an entry chunk: http://webpack.github.io/docs/configuration.html#output-filename
filename: "dist/[name].js",
// Library name (not used)
library: "paqmind.data-lens",
// Format to export library: http://webpack.github.io/docs/configuration.html#output-librarytarget
libraryTarget: "commonjs2",
},
// Enhance debugging: http://webpack.github.io/docs/configuration.html#devtool
devtool: "inline-source-map",
// Options, affecting modules: http://webpack.github.io/docs/configuration.html#module
module: {
// Auto applied loaders: http://webpack.github.io/docs/loaders.html
loaders: [
// JS
{test: /\.(js(\?.*)?)$/, loaders: ["babel?stage=0"], exclude: /node_modules/},
],
},
// Module resolving: http://webpack.github.io/docs/configuration.html#resolve
resolve: {
// Abs. path with modules: http://webpack.github.io/docs/configuration.html#resolve-root
root: Path.resolve("./src"),
// Additional folders: http://webpack.github.io/docs/configuration.html#resolve-modulesdirectories
modulesDirectories: ["web_modules", "node_modules"],
},
// Loader resolving: http://webpack.github.io/docs/configuration.html#resolveloader
resolveLoader: {
// Abs. path with loaders
root: Path.resolve("./node_modules"),
},
};