bower-requirejs
bower-requirejs copied to clipboard
Only add to an existing file
We have a hand-written require config with a lot of comments. Wanted to know if there is interest in working on a version that doesn't touch the file except minimally.
There's a project someone already started on: https://github.com/xerona/bower-requirejs
I had the same problem. Here's the solution I came up with:
- Keep the hand-written require config,
require.hand-config.js
- Create a new require config file just for bower deps. I called it
require.bower-paths.js
- At build time, concatenate
require.hand-config.js
andrequire.bower-paths.js
intorequire.config.js
This works because RequireJS allows require.config({ ... })
to be called multiple times. I've been using this approach for several months and haven't found any downsides yet.