fis-conf.js 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. fis.set('project.exclude', ['**.svn', '**.git', 'sass/**/*.scss', 'Gruntfile.js', 'package.json', 'docs/**', '**.cmd', '**.sh', 'bin/**', 'tpl/**.tmpl']);
  2. fis.set('project.ignore', ['**.cmd', '**.sh', 'fis3-conf.js', 'fis-conf.js', 'js/libs/treeTable/**']);
  3. /*设置编译范围*/
  4. fis.set('project.files', ['src/**']);
  5. /*设置发布路径*/
  6. fis.match(/^\/src\/(.*)/i, {
  7. release: '/$1',
  8. url: '/$1'
  9. });
  10. // 启用 fis-spriter-csssprites 插件
  11. fis.match('::package', {
  12. spriter: fis.plugin('csssprites-ouj', {
  13. scale : 0.5,
  14. rem : 20,
  15. margin: 10
  16. })
  17. }).match('*.scss', {
  18. rExt: '.css',
  19. parser: fis.plugin('node-sass')
  20. // parser: fis.plugin('sass') //旧版
  21. }).match('*.tmpl', {
  22. isJsLike: true,
  23. parser: fis.plugin('utc')
  24. }).match('*.png', {
  25. // fis-optimizer-png-compressor 插件进行压缩,已内置
  26. optimizer: fis.plugin('png-compressor', {
  27. // pngcrush or pngquant, default is pngcrush
  28. type : 'pngcrush'
  29. })
  30. }).match('*.{js,tmpl,tpl,html}', {
  31. postprocessor: fis.plugin('require-async')
  32. }).match('*.js', {
  33. postprocessor: fis.plugin('jswrapper')
  34. }).match(/^\/sass\/((.*)\.(css|less|scss|sass))$/i, {
  35. useSprite: true,
  36. postprocessor: fis.plugin('autoprefixer', {
  37. browsers: ['> 1%', 'last 2 versions'],
  38. cascade: true
  39. }),
  40. url: '/css/$1',
  41. release: '/css/$1'
  42. }).match(/^\/sass\/(.*\.(png|jpg|gif|jpeg))$/i, {
  43. release: 'img/sprite/$1',
  44. url: 'img/sprite/$1'
  45. }).match('_*.scss', {
  46. release: false
  47. })
  48. fis.media('dev').match('*.js', {
  49. useHash: false,
  50. optimizer: null
  51. });
  52. var domain = "http://assets.dwstatic.com/";
  53. var path = "special/s7talent/";
  54. var version = "1.0.0";
  55. fis.media('prod').match('*.{scss,css}', {
  56. useHash: true,
  57. optimizer: fis.plugin('clean-css')
  58. }).match('*.{jpg,png,jpeg,gif,css,scss,js}', {
  59. domain: domain + path + version,
  60. });