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

Create asset filenames mapping on the build output #891

Merged
merged 3 commits into from
Oct 11, 2016

Conversation

lukyth
Copy link
Contributor

@lukyth lukyth commented Oct 11, 2016

To resolve #600

I use webpack-manifest-plugin on Webpack production configuration to create a file named asset-manifest.json which contain a mapping of all asset filenames to their corresponding output file. asset-manifest.json will be located at the root of output folder.

Here's the example from a newly created project.

{
  "main.css": "static/css/main.9a0fe4f1.css",
  "main.css.map": "static/css/main.9a0fe4f1.css.map",
  "main.js": "static/js/main.c9af8c27.js",
  "main.js.map": "static/js/main.c9af8c27.js.map",
  "static/media/logo.svg": "static/media/logo.5d5d9eef.svg"
}

You can see that it doesn't map those files from public/. What do you think?

I use danethurber/webpack-manifest-plugin on Webpack production
configuration to create a file named `asset-manifest.json` which contain a
mapping of all asset filenames to their corresponding output file.

`asset-manifest.json` will be located at the root of output folder.

This'll resolve facebook#600
@facebook-github-bot
Copy link

Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. In order for us to review and merge your code, please sign up at https://code.facebook.com/cla - and if you have received this in error or have any questions, please drop us a line at cla@fb.com. Thanks!

@@ -250,7 +251,10 @@ module.exports = {
}
}),
// Note: this won't work without ExtractTextPlugin.extract(..) in `loaders`.
new ExtractTextPlugin('static/css/[name].[contenthash:8].css')
new ExtractTextPlugin('static/css/[name].[contenthash:8].css'),
new ManifestPlugin({
Copy link
Contributor

Choose a reason for hiding this comment

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

This needs a comment explaining why it is useful

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Comment added. 😄

@@ -65,6 +65,7 @@
"url-loader": "0.5.7",
"webpack": "1.13.2",
"webpack-dev-server": "1.16.1",
"webpack-manifest-plugin": "^1.0.1",
Copy link
Contributor

Choose a reason for hiding this comment

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

Please keep versions exact

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed its version to be exactly 1.0.1

@facebook-github-bot
Copy link

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks!

@gaearon gaearon added this to the 0.7.0 milestone Oct 11, 2016
@gaearon
Copy link
Contributor

gaearon commented Oct 11, 2016

LGTM. Thank you!

@gaearon gaearon merged commit 88c15d0 into facebook:master Oct 11, 2016
@lukyth lukyth deleted the asset_manifest branch October 11, 2016 14:21
feiqitian pushed a commit to feiqitian/create-react-app that referenced this pull request Oct 25, 2016
* Create asset filenames mapping on the build output

I use danethurber/webpack-manifest-plugin on Webpack production
configuration to create a file named `asset-manifest.json` which contain a
mapping of all asset filenames to their corresponding output file.

`asset-manifest.json` will be located at the root of output folder.

This'll resolve facebook#600

* Add an explanation for ManifestPlugin

* Make webpack-manifest-plugin's version exact
jarlef pushed a commit to jarlef/create-react-app that referenced this pull request Nov 28, 2016
* Create asset filenames mapping on the build output

I use danethurber/webpack-manifest-plugin on Webpack production
configuration to create a file named `asset-manifest.json` which contain a
mapping of all asset filenames to their corresponding output file.

`asset-manifest.json` will be located at the root of output folder.

This'll resolve facebook#600

* Add an explanation for ManifestPlugin

* Make webpack-manifest-plugin's version exact
@lock lock bot locked and limited conversation to collaborators Jan 22, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Expose build manifest
3 participants