Skip to content

Instantly share code, notes, and snippets.

@lgh06
Created August 12, 2015 06:08
Show Gist options
  • Save lgh06/b1e99744b3462c93d8e9 to your computer and use it in GitHub Desktop.
Save lgh06/b1e99744b3462c93d8e9 to your computer and use it in GitHub Desktop.
//压缩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