scalableminds / amd-optimize

An AMD (RequireJS) optimizer that's stream-friendly. Made for gulp.
MIT License
162 stars 29 forks source link

please add sugar syntax support for text plugin #45

Open 21paradox opened 9 years ago

21paradox commented 9 years ago

I have a module like below:

define(['jquery',
'knockout',
'text!template1.html',
'text!template2.html',
'text!template3.html',
'text!template4.html',
'text!template5.html',
'text!template6.html'],function($, ko){

  var t1 = require('text!template1.html') 
})

after amd-optimize:

define(['jquery',
'knockout',
'template1.html',
'template2.html',
'template3.html',
'template4.html',
'template5.html',
'template6.html'],function($, ko){

  var t1 = require('text!template1.html') // error throwing
})

please add sugar syntax support for text plugin. Thanks!
rubenspgcavalcante commented 9 years ago

I'm having this problem with the i18n plugin too: require(['i18n!somefile'], function(){ }); //it tries to require a i18n module -> 404 not found mypath/i18n (istead mypath/somefile)

junmer commented 9 years ago

I write a tool gulp-tmpl2js to convert a.html to a.html.js . so, I can require a.html as js module without text plugin. You can take a try :smiley: