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

[WIP] Hooks for subresource integrity #1868

Merged
merged 1 commit into from Jan 9, 2016

Conversation

jscheid
Copy link
Contributor

@jscheid jscheid commented Jan 8, 2016

This adds a new plugin hook that allows adding additional attributes to dynamically created script tags.

@sokra for discussion:

  • webpack-subresource-integrity would need the following contract for the jsonp-script hook: that there is a variable named script in scope, bound to the newly created script element, and a variable chunkId bound to the respective chunk ID. Can this be codified somehow, or can you think of an alternate approach that doesn't require the plugin code to rely on well-known variable names?
  • I haven't found tests for e.g. the require-ensure plugin hook. Do we need to add tests for the jsonp-script hook? If so, where would they go?

@@ -160,7 +160,8 @@ Stats.prototype.toJson = function toJson(options, forToString) {
size: compilation.assets[asset].size(),
chunks: [],
chunkNames: [],
emitted: compilation.assets[asset].emitted
emitted: compilation.assets[asset].emitted,
x: compilation.assets[asset].x || {}
Copy link
Member

Choose a reason for hiding this comment

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

please remove this change from this PR.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

sokra added a commit that referenced this pull request Jan 9, 2016
@sokra sokra merged commit dcc08e7 into webpack:master Jan 9, 2016
@sokra
Copy link
Member

sokra commented Jan 9, 2016

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants