Skip to content

Commit

Permalink
add mod extensions for client
Browse files Browse the repository at this point in the history
  • Loading branch information
hefangshi committed Dec 15, 2015
1 parent 90b74bc commit 8d00293
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
5 changes: 3 additions & 2 deletions yog2-fis3.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ var clientRoadmap = {
release: '/${template}/${namespace}/$1',
useMap: true
},
'client/{components,widget}/**.{js,css}': {
'client/{components,widget}/**.{js,es,ts,tsx,css}': {
isMod: true
},
'client/test/(**)': {
Expand Down Expand Up @@ -129,7 +129,8 @@ fis.require._cache['command-util'] = require('./command/util.js');

// 模块化支持
fis.hook('module', {
mode: 'commonJs'
mode: 'commonJs',
extList: ['.js', '.es', '.ts', '.tsx']
});

// map.json
Expand Down
12 changes: 11 additions & 1 deletion yog2.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,16 @@ function typescriptParser(content, file) {
});
}

// fis.config.set('modules.optimizer.tpl', 'html-minifier');
// fis.config.set('settings.optimizer.html-minifier', {
// ignoreCustomFragments: [
// / ?\{\%[\s\S]*?\%\} ?/g,
// / ?\{\{[\s\S]*?\}\} ?/g
// ],
// collapseWhitespace: true,
// conservativeCollapse: true,
// preserveLineBreaks: true
// });
fis.config.set('roadmap.ext.es', 'js');
fis.config.set('modules.parser.es', typescriptParser);
fis.config.set('roadmap.ext.ts', 'js');
Expand All @@ -65,7 +75,7 @@ var clientRoadmap = [{
url: '${namespace}/widget/$1',
release: '${template}/${namespace}/widget/$1'
}, {
reg: /^\/client\/widget\/(.*\.js)$/i,
reg: /^\/client\/widget\/(.*\.(js|tsx|es|ts))$/i,
isMod: true,
id: 'widget/$1',
release: '${static}/${namespace}/widget/$1'
Expand Down

0 comments on commit 8d00293

Please sign in to comment.