gruntjs - Requirejs optimization with grunt -
gruntjs - Requirejs optimization with grunt -
i trying create requirejs optimization config grunt , almond. here's config:
requirejs: build: options: almond: true dir: 'build' appdir: '' baseurl: '../client' wrap: true include: '../client/main' keepbuilddir: true paths: underscore: 'client/vendor/underscore' jquery : 'client/vendor/jquery' backbone : 'client/vendor/backbone'
folder structure:
error:
c:\users\user\documents\source\project>grunt requirejs running "requirejs:build" (requirejs) task >> error: enoent, no such file or directory >> 'c:\users\user\documents\source\project\build\models\menuitem.js' >> in module tree: >> ../client/main warning: requirejs failed. utilize --force continue.
main.js code (written in coffeescript)
requirejs.config( baseurl: "client" shim: 'backbone': deps: ['jquery'] exports: 'backbone' 'jquery': exports: '$' 'underscore': exports: '_' paths: jquery: 'vendor/jquery-1.11.0' underscore: 'vendor/underscore' backbone: 'vendor/backbone' ) define 'start', ()-> window.types = models: {} collections: {} views: {} null require ['models/menuitem', 'views/menuitem'], (menuitemmodel, menuitemview)-> view = new menuitemview( new menuitemmodel(), "#app", 'first' ) view.render(); null
i want compile entire project spread across multiple js files single file in way requirejs not needed. trying using almond js build task not referenced files relative path of referring file. please help me right configuration.
gruntjs grunt-contrib-requirejs almond requirejs-optimizer
Comments
Post a Comment