forked from esvit/ng-table
-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.js
33 lines (29 loc) · 899 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
const path = require('path');
const merge = require('webpack-merge');
const partsFactory = require('./scripts/webpack/libParts');
const multiConfig = require('./scripts/webpack/multiConfig')(partsFactory);
module.exports = (env = { prod: false, debug: false }) => {
return multiConfig(__dirname, env, createConfig);
}
function createConfig(env, parts) {
const common = merge(
parts.excludeAngular(),
parts.inlineHtmlTemplates(),
parts.forEnvironment(),
parts.typescript('tsconfig-webpack.json')
);
if (env.test) {
return merge(
env.noCoverage ? {} : parts.testCoverage(),
common
);
} else {
return merge(
parts.asUmdLibrary(),
parts.extractSass([
path.join(__dirname, 'src', 'styles', 'ng-table.scss')
]),
common
);
}
}