fis3 打包配置,个人初学者 fis.config.merge({ modules: { postpackager: ['htmlmin'] }, settings: { postpackager: { "htmlmin": { minifyJS: true, removeComments: true } } }})//js压缩fis.match('*.js', { // fis-optimizer-uglify-js 插件
fis.config.merge({ modules: { postpackager: ['htmlmin'] }, settings: { postpackager: { "htmlmin": { minifyJS: true, removeComments: true } } } }) //js压缩 fis.match('*.js', { // fis-optimizer-uglify-js 插件进行压缩,已内置 optimizer: fis.plugin('uglify-js'), }); //css压缩 fis.match('*.css', { // fis-optimizer-clean-css 插件进行压缩,已内置 optimizer: fis.plugin('clean-css'), }); //html压缩 fis.match('*.html', { // fis3-postpackager-htmlmin 插件 // npm i fis3-postpackager-htmlmin postpackager: fis.plugin('htmlmin') }); //添加文件指纹 //输出路径前缀 var path = fis.get('options').d; path = path.replace(/^./,"").replace(/\/$/,""); fis.match('*.{js,css,png,jpg,jpeg,gif,svg,ttf,eot,woff,mp3}', { useHash: true, url: path +'$0' });