Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FIS3的使用 #3

Open
jinjiaxing opened this issue Jan 5, 2018 · 0 comments
Open

FIS3的使用 #3

jinjiaxing opened this issue Jan 5, 2018 · 0 comments

Comments

@jinjiaxing
Copy link
Owner

jinjiaxing commented Jan 5, 2018

FIS3的使用

@(FIS3)[构建工具]

1:安装,必须全局安装

npm install -g fis3 

2:默认配置文件: fis3-conf.js

3: 发布

fis3 release -d <path>
例:fis3 release -d ./ouput

4:常用命令

  • fis.match(selector, props):匹配selector后,进行props设定

    例:fis.match('*.js',{useHash:true}) 匹配全部js文件,使用hash命名

  • fis.media('xxx'):用户针对不同环境的匹配,如下只针对prod生效

    fis.media('prod').match('*.js',{useHash:false})
    fis release prod

  • fis3 inspect 查看哪些文件匹配

    fis3 inspect
    fis3 inspect prod

5: plugin

  • 压缩相关
// 清除其他配置,只保留如下配置
fis.match('*.js', {
  // fis-optimizer-uglify-js 插件进行压缩,已内置
	 optimizer: fis.plugin('uglify-js')
});

fis.match('*.css', {
	// fis-optimizer-clean-css 插件进行压缩,已内置
	optimizer: fis.plugin('clean-css')
});

fis.match('*.png', {
	// fis-optimizer-png-compressor 插件进行压缩,已内置
	optimizer: fis.plugin('png-compressor')
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant