Most of the native configuration from Https://github.com/yanhaijing/fis3-base, the new part of the FIS3 to abandon the component for node_modules, removed some of their own not how to use the function
Set the project Properties Fis.set (' Project.name ', ' fis3-base '), Fis.set (' project.static ', '/static '), Fis.set (' Project.files ', [' *. html ', ' Map.json ', '/test/* ');//introduction of modular development plug-ins, set specifications for the COMMONJS specification. Fis.hook (' Commonjs ', {baseUrl: './modules ', extlist: ['. js ', '. Es ']});//FIS3 using component with plug-ins Fis3-hook-node_modul Es turns plugin dependencies into Node_modulesfis.unhook (' components ') fis.hook (' Node_modules ') fis.match ('/{node_modules}/**.js ', {ismod: True, usesamenamerequire:true});/************************* directory specification *****************************///turn on the same name, Template with the same name depends on Nui with the same name JS with Cssfis.match ('/modules/** ', {usesamenamerequire:true});//------Global configuration//allows you to directly require css+ files in JS fis.m Atch (' *.{ Js,es} ', {preprocessor: [Fis.plugin (' Js-require-file '), Fis.plugin (' Js-require-css ', {mode: ' Dependency '});//Configure Picture compression Fis.match (' **.png ', {optimizer:fis.plugin (' png-compressor ', {type: ' P Ngquant '});//------Configuration Libfis.match ('/lib/**.js ', {release: ' ${project.static}/$& '});//------Configure Modulesfis.match ('/modules/(* *) ', {release: ' ${project.static}/$1 '})//Configure Css//fis.match (/^\/modules\/(. *\). SCSS) $/i, {///Parser:fis.plugin (' sass ', {//include_paths: [' modules/css ', ' components ']//Add files to find directory//})//}); Fis. Match (/^\/modules\/(. *\.less) $/i, {parser:fis.plugin (' less ', {paths: []})}); Fis.match (/^\/modules\/(. *\. ( SCSS|LESS|CSS)) $/i, {rExt: '. css ', ismod:true, Release: ' ${project.static}/$1 ', Postprocessor:fis.plugin (' A Utoprefixer ', {browsers: [' IE >= 8 ', ' Chrome >= ', ' last 2 versions ']//PC//browsers: [' Android OID >= 4 ', ' chromeandroid > 1% ', ' IOS >= 6 ']//WAP}), Fis.match (/^\/modules\/(. *\. (?:p ng|jpg|gif)) $/i, { Release: ' ${project.static}/$1 ');//config Jsfis.match (/^\/modules\/(. *\.js) $/i, {parser:fis.plugin (' babel-5.x '), rEx T: ' JS ', ismod:true, Release: ' ${project.static}/$1 '}), Fis.match (/^\/modules\/(. *\.js) $/i, {ismod:true, rel Ease: ' ${project.static}/$1 '});------Configuring the front End template using Template.js//fis.match (' **.tmpl ', {///Parser:fis.plugin (' template ', {//STag: ' <# ',//ET AG: ' #> ',//Global: ' Template '//}),//isjslike:true,//release:false//});//------Configure analog Data Fis.match ('/test/** ' {release: ' $ '} ', Fis.match ('/test/server.conf ', {release: '/config/server.conf ');/************************* packaging rules Fan *****************************///because it is a pure front-end project, the dependency can not be loaded in, so it is necessary to use a loader to complete,//Note: The project with the back end does not require this plug-in!!! Fis.match ('::p ackage ', {//NPM install [-G] fis3-postpackager-loader//analyze __resource_map__ structure to solve the problem of resource loading POSTPAC Kager:fis.plugin (' loader ', {resourcetype: ' commonJs ', useinlinemap:true//Resource Mapping Table inline})});//debug suffix does not press Shrink var map = {' rd ': {//project published to specified machine host: ' ', Path: '}, ' Rd-debug ': {//view the case of a project published to a specified machine (uncompressed version) Host: ', Path: '}, ' prod ': {//Publish Project Host: ', Path: '/${project.name} '}, ' prod- Debug ': {//View the published item (uncompressed version) host: ', Path: '}};//Universal 1. Replace the URL prefix 2. Add MR5 Code 3. Pack 4. Figure 5. Redefine the resource path Object.keys (map). ForEach (function (v) {var o = map[ V]; var domain = o.host + o.path; Fis.media (v). Match (' **.{ ES,JS} ', {usehash:true, domain:domain}). Match (' **.{ SCSS,LESS,CSS} ', {usesprite:true, usehash:true, Domain:domain}). Match (':: Image ', {usehash:true, domain:domain}). Match (' **/(*_{x,y,z}.png) ', { Release: '/pkg/$1 '})//enable package plugin, must match::p ackage. Match ('::p ackage ', {Spriter:fis.plugi N (' Csssprites ', {layout: ' Matrix ',//scale:0.5,//mobile twice times graph with margin: ' 10 ' }), Postpackager:fis.plugin (' loader ', {allinone:true,})}) . Match ('/lib/es5-{shim,sham}.js ', {packto: '/pkg/es5-shim.js '}). Match ('/comPonents/**.css ', {packto: '/pkg/components.css '}). Match ('/components/**.js ', {pack To: '/pkg/components.js '}). Match ('/modules/**.{ SCSS,LESS,CSS} ', {packto: '/pkg/modules.css '}). Match ('/modules/css/**.{ SCSS,LESS,CSS} ', {packto: '}). Match ('/modules/css/common.scss ', {packto: '/pkg/co Mmon.css '}). Match ('/modules/**.{ ES,JS} ', {packto: '/pkg/modules.js '}). Match ('/modules/app/**.{ ES,JS} ', {packto: '/pkg/aio.js '})//For online convenience, publish static files to the same directory//. Match (' **/(*.{ Css,less,scss,es,js,jpg,png,gif}) ', {//release: '/prod/$1 '//}});//Compression CSS JS Htmlobject.keys (map) . filter (function (v) {return v.indexof (' debug ') < 0}). ForEach (function (v) {Fis.media (v) . Match (' **.{ ES,JS} ', {optimizer:fis.plugin (' Uglify-js ')}). Match (' **.{ SCSS,LESS,CSS} ', {optimizer:fis.plugin (' clean-css ', {' Keepbreaks ': true//keep a rule one line break }) }); });//local output released Fis.media (' prod '). Match (' * * ', {deploy: [Fis.plugin (' skip-packed '), {// Default is packaged with JS and CSS and the CSS Sprite merged image will be filtered out here,//But if these files meet the following rules, then still do not filter ignore: [] }), Fis.plugin (' Local-deliver ', {to: ' Output '})});//Publish to the specified machine//[' rd ' , ' Rd-debug '].foreach (function (v) {///Fis.media (v)//. Match (' * ', {//deploy: [///Fis.plugin (' s Kip-packed ', {/////The default is packaged with JS and CSS and images that have been merged by CSS Sprite will be filtered here,///But if these files meet the following rules, Still not filtered//ignore: []//}],//Fis.plugin (' Http-push ', {//Receive R: ' xxx/fisreceiver.php ',//To: ' xxx/' + fis.get (' project.name ')//})// ]// });//});
Package.json
{ "name": "", "version": "", "description": "", "repository": { "type": "Git", "url": "" }, "Devdependencies": { "fis-parser-babel-5.x": "^1.4.0", " fis-parser-less": "^0.1.3", " Fis-parser-template ":" ^0.3.3 ", " Fis-postprocessor-autoprefixer ":" 0.0.5 ", " fis3-deploy-skip-packed ":" 0.0.5 ", " Fis3-hook-commonjs ":" ^0.1.26 ", " Fis3-hook-node_modules ":" ^2.2.8 ", " Fis3-postpackager-loader ":" ^2.1.4 ", " Fis3-postprocessor-autoprefixer ":" ^1.0.0 ", " Fis3-preprocessor-js-require-css ":" ^0.1.1 ", " Fis3-preprocessor-js-require-file ":" ^0.1.3 " }}
FIS3 configuration (with Package.json)