Skip to content

"Vendor" folder #28

Closed
Closed
@gaearon

Description

@gaearon

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

gaearon commented on Jul 19, 2016

@gaearon
ContributorAuthor
frederikcreemers

frederikcreemers commented on Jul 23, 2016

@frederikcreemers

This would also be useful for files referenced solely in index.html, like manifest.json, or apple-touchìcon.png, and scripts like web workers and service workers.

gaearon

gaearon commented on Jul 23, 2016

@gaearon
ContributorAuthor

This would also be useful for files referenced solely in index.html, like manifest.json, or apple-touchìcon.png, and scripts like web workers and service workers.

Yep.

cliedeman

cliedeman commented on Jul 23, 2016

@cliedeman

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

gaearon commented on Jul 23, 2016

@gaearon
ContributorAuthor

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

ForbesLindesay commented on Jul 25, 2016

@ForbesLindesay
Contributor

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

gaearon commented on Jul 25, 2016

@gaearon
ContributorAuthor

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.

added this to the 0.2.0 milestone on Jul 25, 2016
baadc0de

baadc0de commented on Jul 26, 2016

@baadc0de

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

lacker commented on Jul 26, 2016

@lacker
Contributor

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 to assets which implies that it has to be some sort of image or media asset.

hnordt

hnordt commented on Jul 26, 2016

@hnordt
Contributor

static looks like a better name than vendor or assets.

mxstbr

mxstbr commented on Jul 26, 2016

@mxstbr
Contributor

I love static, working on a PR now! 🚢

33 remaining items

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @timarney@lacker@eMerzh@PrimeLens@frederikcreemers

        Issue actions

          "Vendor" folder · Issue #28 · facebook/create-react-app