Skip to content
This repository has been archived by the owner on Feb 18, 2024. It is now read-only.

Set name defaults for file/url-loader #435

Merged

Conversation

timkelty
Copy link
Contributor

@timkelty timkelty commented Nov 15, 2017

This provides predictable paths for when using dev-server.
This makes for easier use in a server-side context, and makes things more consistent with how js is named and rev'd.

.rule('svg')
.test(/\.svg(\?v=\d+\.\d+\.\d+)?$/)
.use('url')
.loader(urlLoader)
.options(merge({ limit }, options.svg || {}));
.options(merge({ limit, name }, options.svg));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

options.svg || {}

.rule('img')
.test(/\.(png|jpg|jpeg|gif)(\?v=\d+\.\d+\.\d+)?$/)
.use('url')
.loader(urlLoader)
.options(merge({ limit }, options.img || {}));
.options(merge({ limit, name }, options.img));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

options.img || {}

.rule('ico')
.test(/\.ico(\?v=\d+\.\d+\.\d+)?$/)
.use('url')
.loader(urlLoader)
.options(merge({ limit }, options.ico || {}));
.options(merge({ limit, name }, options.ico));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

options.ico || {}

@timkelty
Copy link
Contributor Author

My bad, changes made.

Copy link
Member

@eliperelman eliperelman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@eliperelman
Copy link
Member

@edmorley how would you feel about cherry picking this and #434 into release/v7?

@edmorley
Copy link
Member

I'd have to look in more detail, but some of the changes in the other PR seem borderline breaking, depending on the weird and wonderful things other people are doing :-)

@timkelty
Copy link
Contributor Author

timkelty commented Nov 16, 2017

@edmorley @eliperelman I did a quick review of the borderline-breaking issues here: #434 (comment)

@eliperelman
Copy link
Member

Agreed, this would probably be breaking, we can ship this for v8, and explore demand for v7.

@eliperelman eliperelman merged commit d680010 into neutrinojs:master Nov 21, 2017
@timkelty timkelty deleted the predictable-paths-for-dev-server branch November 21, 2017 11:37
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants