forked from webpack-contrib/purifycss-webpack
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.js
52 lines (49 loc) · 1.03 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
const path = require('path');
const merge = require('webpack-merge');
const glob = require('glob');
const parts = require('./webpack.parts');
const PATHS = {
app: path.join(__dirname, 'app'),
another: path.join(__dirname, 'another'),
build: path.join(__dirname, 'build')
};
module.exports = [
merge(
{
entry: {
app: PATHS.app
},
output: {
path: path.join(PATHS.build, 'first'),
filename: '[name].js'
}
},
parts.extractCSS(),
parts.purifyCSS({
verbose: true,
minimize: true,
paths: glob.sync(`${PATHS.app}/*`),
styleExtensions: ['.css']
})
),
merge(
{
entry: {
first: PATHS.app,
second: PATHS.another
},
output: {
path: path.join(PATHS.build, 'second'),
filename: '[name].js'
}
},
parts.extractCSS(),
parts.purifyCSS({
paths: {
first: glob.sync(`${PATHS.app}/*`),
second: glob.sync(`${PATHS.another}/*`)
},
styleExtensions: ['.css']
})
)
];