Closed
Description
Let’s wait until somebody asks before implementing but.. I think a vendor
folder that just gets copied into the output could be a useful escape hatch. For example, if you have a global script that isn’t UMD-friendly, you want to have some way of importing it. With a vendor
folder, you could just put it there, reference it from index.html
, and read from window
in your bundle.
Activity
gaearon commentedon Jul 19, 2016
https://www.npmjs.com/package/copy-webpack-plugin
frederikcreemers commentedon Jul 23, 2016
This would also be useful for files referenced solely in index.html, like
manifest.json
, orapple-touchìcon.png
, and scripts like web workers and service workers.gaearon commentedon Jul 23, 2016
Yep.
cliedeman commentedon Jul 23, 2016
Hi there, I just bumped into this issue.
I am trying to implement this using
copy-webpack-plugin
but I can't figure out how to test my branch.Are there are notes on doing this?
Ciaran
gaearon commentedon Jul 23, 2016
Does this help? https://github.com/facebookincubator/create-react-app#contributing
Also, we’d need to solve #21 first because this change will also have implications for it.
ForbesLindesay commentedon Jul 25, 2016
vendor doesn't seem like the right name here. Seems more like it should be something like "assets". i.e. this is about serving files that don't need building, not necessarily files that have been vendored in.
gaearon commentedon Jul 25, 2016
Yeah, I agree it’s a bad name. (I don’t like
assets
because people will immediately think it’s the place to put their CSS and images in.. which it is not.)Maybe we should just use html-loader and make it that
<link href>
is automatically rewritten and those files are also processed by webpack. I feel like this could solve the majority of cases (e.g. touch icons or vendor CSS sheets), and even use webpack’s features like content hashes.baadc0de commentedon Jul 26, 2016
I've been using
static
for some time now, with good understanding from the rest of the team(s) about it containing purely copied, unprocessed assets. It has been a useful crutch for when a resource path is dynamically generated and/or webpack processing is not required/wanted.lacker commentedon Jul 26, 2016
I like the name
static
- it's the folder name Django encourages, and it is also a pretty accurate description of what goes there - the files that are not dynamically generated by some process, but are just a static copy of what's in your filesystem. As opposed toassets
which implies that it has to be some sort of image or media asset.hnordt commentedon Jul 26, 2016
static
looks like a better name thanvendor
orassets
.mxstbr commentedon Jul 26, 2016
I love
static
, working on a PR now! 🚢33 remaining items