-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.js
40 lines (30 loc) · 914 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
39
40
//--------------------------------------------------------
//-- webpack configuration
//--------------------------------------------------------
'use strict';
const merge = require('lodash.merge');
const libraryBuilder = require('@absolunet/library-builder');
libraryBuilder.setRoot(__dirname);
//-- Node.js
const nodeConfig = merge({}, libraryBuilder.config.node, {
externals: [
]
});
//-- Web
const webExternals = {
externals: {
}
};
const webConfig = merge({}, libraryBuilder.config.web, webExternals);
const webES5Config = merge({}, libraryBuilder.config.webES5, webExternals);
module.exports = [nodeConfig, webConfig, webES5Config];
module.exports.forEach((config) => {
config.module = config.module || {};
config.module.rules = config.module.rules || [];
config.module.rules.push({
enforce: "pre",
test: /\.js$/,
exclude: /node_modules/,
loader: 'eslint-loader'
});
});