2
所以我使用yeoman init創建了一個項目,它使用requirejs,我希望用almondjs替換requirejs以使其加載速度更快。我怎樣才能做到這一點?如何用yeoman Gruntfile.js替換requirejs與almondjs?
AlmondJS是在這裏:https://github.com/jrburke/almond
RequireJS是在這裏:http://requirejs.org/
在Gruntfile.js require.js的唯一一提的是:
// rjs configuration. You don't necessarily need to specify the typical
// `path` configuration, the rjs task will parse these values from your
// main module, using http://requirejs.org/docs/optimization.html#mainConfigFile
//
// name/out/mainConfig file should be used. You can let it blank if
// you're using usemin-handler to parse rjs config from markup (default
// setup)
rjs: {
// no minification, is done by the min task
optimize: 'none',
baseUrl: './scripts',
wrap: true,
name: 'main'
},
嗨,但我的Gruntfile中沒有requirejs,我的意思是 - yeoman生成一個Gruntfile.js,唯一需要提到的是: – Phil 2013-03-20 05:44:54
rjs在1.0版之前的Yeoman中使用。從Yeoman 1.0開始,應該用grunt-requirejs替換。至少這是我的理解。 – Trott 2013-03-20 05:46:28
我會盡力謝謝! – Phil 2013-03-20 05:47:24