目标:
github测试库: https://github.com/mafar/requirejs-almond-boilerplate
cd requirejs-almond-boilerplate
然后npm install
然后grunt
Gruntfile.js选项:
requirejs: {
compile: {
options: {
appDir: './www',
baseUrl: './',
mainConfigFile: './www/js/common.js',
optimize: 'uglify',
optimizeCss: 'standard.keepLines.keepWhitespace',
preserveLicenseComments: true,
dir: 'www-release',
findNestedDependencies: true,
insertRequire: ['common'],
name: 'js/common', // name: 'js/vendor/almond', //almond
include: ['js/vendor/almond'],
}
}
},