****************基础配置**************** { mode: 模块化类型(AMD,CDM, CommandJs) baseUrl: 基础路径 path: 配置别名或者路径 } */ fis.hook('module', { mode: 'commonJs', baseUrl: "./modules/", paths: { api: "common/api/", base: "common/base/", ... } }); fis.hook('relative'); fis.match('/modules/**.js', { isMod: true }); fis.match('**.{tmpl,txt,md}', { release: false }); fis.match('::package', { postpackager: fis.plugin('loader', { resourceType: 'commonJs', useInlineMap: true }) }); fis.match('::packager', { postpackager: fis.plugin('loader', { allInOne: true }) }); fis.match('*.{js,css,png,jpg,gif}', { useHash: true }); fis.match('*.js', { optimizer: fis.plugin('uglify-js') }); fis.media("debug").match('*.js', { optimizer: null }); fis.match('*.css', { optimizer: fis.plugin('clean-css') }); fis.match('*.png', { optimizer: fis.plugin('png-compressor') }); fis.match('/libs/**.js', { packTo: '/libs/mod.js' }); fis.match('modules/common/**.js', { packTo: 'modules/common/common.js' }); fis.match('views/css/**.css', { packTo: 'views/css/style.pack.css' }); fis.match('modules/common/**.css', { packTo: 'views/css/common.pack.css' }); fis.match('views/**.{png,jpg,gif}', { release: '$0' }); fis.match('modules/**/(*.{png,jpg,gif})', { release: '/views/images/$1' }); fis.match('views/(**.html)', { release: '$1' }); fis.match('**', { relative: true });
|