Third-Party Scripts
Sometimes you will need to include third-party or "vendor" scripts with your project. For example, you may want to download a copy of jquery and include this in your output. However, spike automatically pulls in and processes any .js
file in your project unless it's ignored. But with vendor scripts, it would be better for Spike not to touch them, and just copy through to the output.
If you have any type of file that you'd like to be copied directly through to the output and not processed at all by webpack in this manner, you can simply use the vendor
key along with one or more glob matchers. For example, let's say I made an assets/vendor
folder and put some third-party css and js files in there that I needed for my site. In order to have them copied over without being touched, I'd add this to my app.js file:
module.exports = {
// ...
vendor: 'assets/vendor/**'
}
...and that's it! They will be copied over like any other static file.
Updated less than a minute ago