forked from googlecodelabs/tools
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathopts.js
97 lines (87 loc) · 1.85 KB
/
opts.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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
'use strict';
const autoprefixer = require('autoprefixer');
const closureCompilerPackage = require('google-closure-compiler');
const cssdeclarationsorter = require('css-declaration-sorter');
const cssnano = require('cssnano');
exports.babel = () => {
return {
presets: ['es2015'],
};
};
exports.closureCompiler = () => {
return {
compilation_level: 'ADVANCED',
warning_level: 'VERBOSE',
language_out: 'ECMASCRIPT5_STRICT',
generate_exports: true,
export_local_property_definitions: true,
output_wrapper: '(function(window, document){\n%output%\n})(window, document);',
js_output_file: 'cardsorter.js',
};
};
exports.crisper = () => {
return {
scriptInHead: false,
};
};
exports.htmlmin = () => {
return {
collapseWhitespace: true,
conservativeCollapse: true,
preserveLineBreaks: true,
removeComments: true,
useShortDoctype: true,
};
};
exports.postcss = () => {
return [
autoprefixer({
browsers: [
'ie >= 10',
'ie_mob >= 10',
'ff >= 30',
'chrome >= 34',
'safari >= 7',
'opera >= 23',
'ios >= 7.1',
'android >= 4.4',
'bb >= 10',
],
}),
cssdeclarationsorter({ order: 'alphabetically' }),
cssnano(),
];
};
exports.sass = () => {
return {
outputStyle: 'expanded',
precision: 5,
};
};
exports.uglify = () => {
return {
compress: {
drop_console: true,
keep_infinity: true,
passes: 5,
},
output: {
beautify: false,
},
toplevel: false,
};
};
exports.vulcanize = () => {
return {
excludes: ['prettify.js'], // prettify produces errors when inlined
inlineCss: true,
inlineScripts: true,
stripComments: true,
stripExcludes: ['iron-shadow-flex-layout.html'],
};
};
exports.webserver = () => {
return {
livereload: false,
};
};