-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.js
38 lines (34 loc) · 994 Bytes
/
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
const Path = require('path');
const webpackConfig = require('@syntro-opensource/webpack-config');
const {
resolves,
modules,
plugins,
} = webpackConfig;
const ENV = process.env.NODE_ENV;
const PATHS = {
// the root path, where your webpack.config.js is located.
ROOT: Path.resolve(),
// your node_modules folder name, or full path
MODULES: 'node_modules',
// thirdparty folder containing copies of packages which wouldn't be available on NPM
THIRDPARTY: 'thirdparty',
// the root path to your javascript source files
SRC: Path.resolve('client/src'),
};
const config = [{
name: 'klaro',
entry: {
main: Path.resolve(__dirname, 'client/src/bundle.js')
},
output: {
path: Path.resolve(__dirname, 'client/dist'),
filename: 'klaro.js',
},
devtool: (ENV !== 'production') ? 'source-map' : '',
resolve: resolves(ENV, PATHS),
module: modules(ENV, PATHS),
plugins: plugins(ENV, PATHS),
}
];
module.exports = config;