【发布时间】:2015-01-30 10:36:28
【问题描述】:
我正在通过 grunt 使用 requirejs 优化器 (r.js),这是我的 requirejs 配置:
requirejs.config
baseUrl: '/scripts'
locale: window.localStorage.getItem('locale') || null
...
问题是每次我尝试在我的 requirejs 配置中使用变量时,grunt r.js 插件 (https://github.com/gruntjs/grunt-contrib-requirejs) 都会引发错误。
The main config file cannot be used because it cannot be evaluated correctly while running in the optimizer. Try only using a config that is also valid JSON, or do not use mainConfigFile and instead copy the config values needed into a build file or command line arguments given to the optimizer.
您是否设法同时使用变量作为语言环境和 r.js?
【问题讨论】:
标签: javascript gruntjs requirejs r.js grunt-contrib-requirejs