javascript - Load minified files generated by WebEssentials with RequireJS -
i used webessential tool generate minified version typescript files, right have .min.js files.
now want use minified files version on project, never loaded.
i use import modules this:
import controller1 = require('ctls/controller1');
but loads normal .js file .
so how change behaviour , load minified version ?
you can use require config entry. see here: http://requirejs.org/docs/api.html#config
for example might let switch , forth easily:
var minifiedpaths = { "controller1": "ctls/controller1.min" }; var devpaths = { "controller1": "ctls/controller1" }; require.config({ paths: minifiedpaths });
and change require call import controller1 = require('controller1');
note typescript has issues aliasing amd modules this, might need keep same name if want continue strong typing (or store d.ts file in same location emitted library).
Comments
Post a Comment