forked from xuexb/blog
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstc.admin.config.js
45 lines (42 loc) · 1 KB
/
stc.admin.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
var stc = require('stc');
var cssCompress = require('stc-css-compress');
var resourceVersion = require('stc-resource-version');
var cssCombine = require('stc-css-combine');
var htmlCompress = require('stc-html-compress');
var replace = require('stc-replace');
// var uglify = require("stc-uglify");
stc.config({
product: "admin",
include: ["view/admin/", "www/static/admin/"],
exclude: [/www\/static\/admin\/src\//],
outputPath: "output",
tpl: {
engine: "nunjucks",
ld: ["{%", "{{", "{#"],
rd: ["%}", "}}", "#}"],
},
});
stc.workflow({
// uglify: {
// plugin: uglify,
// exclude: [/static\/admin\//], // 后台管理不压缩,因为 webpack 压缩过了
// },
cssCombine: { plugin: cssCombine, include: /\.css$/ },
cssCompress: {
plugin: cssCompress,
},
htmlCompress: {
plugin: htmlCompress,
options: {
trim: true,
},
},
resourceVersion: {
options: {
length: 5,
type: "query",
},
plugin: resourceVersion,
},
});
stc.start();