简体   繁体   中英

r.js: Is it possible to specify multiple include/exclude on the command line?

With r.js if I enter the following on the command line exclude=bootstrap the expected results are obtained. However, if i enter exclude=['bootstrap', 'jquery'] the following error occurs:

Tracing dependencies for: ['bootstrap'
Error: Error: ENOENT, no such file or directory    'c:\users\justin\appdata\local\temp\tmpnojtra\core\js\['bootstrap'.js'

Clearly the array is not being parsed correctly by r.js, so i wonder if there is another syntax required to allow multiple includes/excludes or it's just not possible?

It uses an unexpected syntax. See this message from RequireJS's author. Basically, you remove the brackets, spaces, string quotes that you'd put in the JavaScript, and what remains is what you put on the command line.

In your case exclude=bootstrap,jquery should do the trick.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM