Created
August 12, 2015 06:08
-
-
Save lgh06/b1e99744b3462c93d8e9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//压缩js 配置 | |
fis.config.set('settings.optimizer.uglify-js', { | |
mangle: { | |
except: 'exports, module, require, define,bed,wx,jQuery,$' | |
} | |
}); | |
//自动去除console.log等调试信息 | |
fis.config.set('settings.optimizer.uglify-js', { | |
compress: { | |
drop_console: true | |
} | |
}); | |
//编译的文件 | |
fis.set('project.files', [ | |
'/public/**' | |
]); | |
//忽略文件 | |
fis.set('project.ignore', ['.idea/**', | |
'.svn/**']); | |
//将符合规则的文件进行过滤 编译 并转移到release目录 | |
//所有css文件 | |
fis.match('/public/**.css', { | |
useHash: true, | |
optimizer: fis.plugin('clean-css'), | |
release: '/output/$0', | |
domain: 'http://www.shuiqian.cc' | |
}); | |
//less文件 忽略 | |
fis.match('**.less', { | |
// 设置 release 为 FALSE,不再产出此文件 | |
release: false | |
}); | |
//首页index.js 添加hash uglify-js | |
fis.match('/public/{index,sharing,js}/**.js', { | |
useHash: true, | |
optimizer: fis.plugin('uglify-js'), | |
release: '/output/$0', | |
domain: 'http://www.shuiqian.cc' | |
}); | |
//首页index.js 添加hash uglify-js | |
fis.match('/public/{index,sharing,js}/**.min.js', { | |
useHash: false, | |
optimizer: null, | |
release: '/output/$0', | |
domain: 'http://www.shuiqian.cc' | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment