Last active
August 29, 2015 14:06
-
-
Save jinzhubaofu/ae52157a99f38e5276a5 to your computer and use it in GitHub Desktop.
edp md5renamer example
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
require.config({ | |
baseUrl: '{%$tplData.feRoot%}/src', | |
paths: { | |
moye: '../dep/moye/src/ui', | |
etpl: '../dep/etpl/2.1.0/src/main', | |
Q: '../dep/q/q', | |
underscore: '../dep/underscore/1.6.0/src/underscore', | |
common: './common/' | |
}, | |
packages: [{ | |
name: 'when', | |
main: 'when' | |
}], | |
urlArgs: '{edp-variable:version}' | |
}); |
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
var variable = new VariableSubstitution({ | |
files: ['*.tpl'], | |
variables: { | |
version: process.env.CENTER_BRANCH || process.env.BUILD_NUMBER || '1.0.0' | |
} | |
}); |
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
var tplMD5Renamer = new MD5Renamer({ | |
files: [ | |
'src/**/*.tpl', | |
'*.less', '*.png', '*.jpg', '*.gif', '*.jpeg', | |
'*.eot', '*.svg', '*.ttf', '*.woff' | |
], | |
resolve: function (lookup, a) { | |
if (a.indexOf('/dep/') !== -1) { | |
return false; | |
} | |
return a.indexOf( '{%$tplData.feRoot|escape:html%}' ) === 0 | |
? a.replace( '{%$tplData.feRoot|escape:html%}/', '' ) | |
: false; | |
}, | |
outputTemplate: '{basename}.{md5sum}{extname}' | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment