Last active
May 3, 2016 03:29
-
-
Save oxUnd/2f9bd13ed2c8591d2a5f to your computer and use it in GitHub Desktop.
fis3
This file contains hidden or 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
fis.set('namespace', 'common'); | |
//-- system settings | |
fis.set('server', { | |
'libs': 'pc', | |
}); | |
fis.set('plugin less', { | |
sourceMap: true | |
}); | |
fis.set('smarty', { | |
left_delimiter: '{%', | |
right_delimiter: '%}' | |
}); | |
fis.match('/plugin/**.php', { | |
release: '$&' | |
}); | |
fis.media('dev').set('domain', ''); | |
fis.media('prod').set('domain', { | |
css: 'http://cdn.baidu.com/', | |
image: 'http://cdn.baidu.com/', | |
js: 'http://cdn.baidu.com/' | |
}); | |
//-- map.json | |
fis.match('map.json', { | |
release: '$&' | |
}); | |
//-- css like file | |
fis.match('**.(css|scss|less)', { | |
optimizer: fis.plugin('clean-css', fis.get('plugin clean-css')), | |
domain: fis.get('domain').css, | |
useHash: true | |
//release: '/static/${namespace}/$&' | |
}); | |
fis.match('**.less', { | |
parser: fis.plugin('less'), | |
isCssLike: true, | |
ext: 'css' | |
}); | |
fis.match('**.scss', { | |
parser: fis.plugin('scss'), | |
isCssLike: true, | |
ext: 'css' | |
}); | |
fis.match('/widget/**.(css|scss|less)', { | |
release: '/static/${namespace}/$&' | |
}); | |
fis.match('/static/(**.(css|scss|less))', { | |
release: '/static/${namespace}/$1' | |
}); | |
//-- js like file | |
fis.match('**.js', { | |
optimizer: fis.plugin('uglify-js') | |
domain: fis.get('domain').js, | |
useHash: true | |
}); | |
fis.match('/widget/**.js', { | |
postprocessor: fis.plugin('jswrapper'), //isMod | |
release: '/static/${namespace}/$&' | |
}); | |
fis.match('/static/(**.js)', { | |
release: '/static/${namespace}/$1' | |
}); | |
//-- html like file | |
fis.match('**.tpl', { | |
id: '$&', | |
useMap: true, | |
isHtmlLike: true, | |
optimizer: [fis.plugin('smarty-xss'), fis.plugin('html-compress')], | |
release: '/template/${namespace}/$&' | |
}); | |
//-- image | |
fis.match('**.(png|gif|jpeg|jpg)', { | |
optimizer: fis.plugin('png-compressor'), | |
useHash: true, | |
release: '/static/$&' | |
}); | |
//------ | |
fis.media('dev').match('**', { | |
useOptimizer: false, | |
useHash: false | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@zgp626 尽量会使这个东西没有什么晦涩之处。