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

Output generated files under an assets/ subdirectory #1174

Merged
merged 1 commit into from Oct 15, 2018
Merged

Output generated files under an assets/ subdirectory #1174

merged 1 commit into from Oct 15, 2018

Conversation

edmorley
Copy link
Member

@edmorley edmorley commented Oct 13, 2018

This makes it easier to write Cache-Control header rules for files with hashed filenames, since the web server rule can now just match the entire assets/ directory rather than having to use false-positive prone regex to match the hash in the filename.

In addition, this PR removes some redundant configuration:

Fixes #1172.

@edmorley edmorley added this to the v9 milestone Oct 13, 2018
@edmorley edmorley self-assigned this Oct 13, 2018
@edmorley edmorley requested review from eliperelman and timkelty Oct 13, 2018
@edmorley edmorley changed the title Output generated files under an assets/ directory Output generated files under an assets/ subdirectory Oct 14, 2018
This makes it easier to write `Cache-Control` header rules for files
with hashed filenames, since the web server rule can now just match
the entire `assets/` directory rather than having to use false-positive
prone regex to match the hash in the filename.

In addition, this PR removes some redundant configuration:
* The `@neutrinojs/node` and `@neutrinojs/library` presets no longer
  set `output.filename` / `output.chunkFilename`, since they were
  previously only being set to the defaults anyway.
* The `@neutrinojs/web` preset no longer sets `output.chunkFilename`
  since by default it inherits from `output.filename`, so setting both
  to the same value is redundant:
  https://github.com/webpack/webpack/blob/v4.20.2/lib/WebpackOptionsDefaulter.js#L102-L112

Fixes #1172.
Copy link
Contributor

@timkelty timkelty left a comment

LGTM!

@edmorley edmorley merged commit 6bef97a into neutrinojs:master Oct 15, 2018
2 checks passed
@edmorley edmorley deleted the assets-dir branch Oct 15, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

None yet

2 participants