Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

@eliperelman eliperelman Nov 15, 2017

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

@eliperelman eliperelman Nov 15, 2017

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

@eliperelman eliperelman Nov 15, 2017

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

@timkelty timkelty commented Nov 16, 2017

My bad, changes made.

Copy link
Member

@eliperelman eliperelman left a comment

LGTM!

@eliperelman
Copy link
Member

@eliperelman eliperelman commented Nov 16, 2017

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

@edmorley
Copy link
Member

@edmorley edmorley commented Nov 16, 2017

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 timkelty commented Nov 16, 2017

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

@eliperelman
Copy link
Member

@eliperelman eliperelman commented Nov 16, 2017

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
2 checks passed
@timkelty timkelty deleted the predictable-paths-for-dev-server branch Nov 21, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants