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

Conversation

@edmorley
Copy link
Member

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 force-pushed the edmorley:assets-dir branch from a4d42ae to 7f042c7 Oct 14, 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.
@edmorley edmorley force-pushed the edmorley:assets-dir branch from 7f042c7 to 2a3861e Oct 14, 2018
Copy link
Contributor

timkelty left a comment

LGTM!

@edmorley edmorley added the feature label Oct 15, 2018
@edmorley edmorley merged commit 6bef97a into neutrinojs:master Oct 15, 2018
2 checks passed
2 checks passed
continuous-integration/travis-ci/pr The Travis CI build passed
Details
deploy/netlify Deploy preview ready!
Details
@edmorley edmorley deleted the edmorley:assets-dir branch Oct 15, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.