-
Notifications
You must be signed in to change notification settings - Fork 6
/
common.config.js
63 lines (62 loc) · 1.53 KB
/
common.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
56
57
58
59
60
61
62
63
const cssnano = require('cssnano');
const postcssImport = require('postcss-import');
const postcssUrl = require('postcss-url');
const postcssCssNext = require('postcss-cssnext');
module.exports = {
webpackModule: {
preLoaders: [{
test: /\.js$/,
exclude: /node_modules/,
loader: 'eslint-loader'
}],
loaders: [
{
// automatically load css into the DOM
test: /\.css$/,
loader: 'style!css!postcss'
},
{
test: /\.scss$/,
loader: 'style!css!postcss!sass'
},
{
// compress and load images as embedded data-uri's
test: /\.(jpe?g|png|gif|svg)$/,
loader: 'url!img?minimize'
}, {
// load static html snippets as strings
test: /\.html$/,
loader: 'html'
}, {
// load dot template as compiler fn
test: /\.dot$/,
loader: 'dot'
}, {
// load ES6 template string as compiler fn
test: /\.tmpl$/,
loader: 'babel?plugins[]=transform-es2015-template-literals!template-string'
},
{
// transpile all javascript from ES6 to ES5
test: /\.js$/,
loader: 'babel',
exclude: /node_modules/,
query: {
presets: ['es2015-loose']
}
}]
},
postcss(webpack) {
return [
postcssImport({
addDependencyTo: webpack
}),
postcssUrl(),
postcssCssNext({
browsers: ['last 2 versions', 'ie >= 9'],
compress: true
}),
cssnano({zindex: false})
];
}
};