-
Notifications
You must be signed in to change notification settings - Fork 400
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
Upgrade to webpack 2 #2380
Merged
+716
−338
Merged
Upgrade to webpack 2 #2380
Changes from all commits
Commits
Show all changes
30 commits
Select commit
Hold shift + click to select a range
2294658
first pass at webpack 2 upgrade
kumar303 631a9a2
upgrade extract-text-webpack-plugin
kumar303 1979568
removed unnecessary plugins, fixed defaults for the new uglify
kumar303 a688738
upgraded loader chains
kumar303 999cf94
fixed karma webpack config
kumar303 488aba2
converted loader query strings to option objects
kumar303 84ec3ec
fixed postcss options
kumar303 f323abe
resolve __dirname, why not?
kumar303 142d1b7
DRY up module.rules
kumar303 99be0a7
DRY up plugins
kumar303 c52d771
Throw a better error message here
kumar303 ed1308b
fix syntax error
kumar303 eff7d10
Switch to a fork of the sri-stats-webpack-plugin plugin
kumar303 0f096fb
building and running the app locally both require env vars
kumar303 d093fd9
Upgrade babel-loader
kumar303 79ea4ed
fix lint errors
kumar303 0becc82
better comments about replacement plugins
kumar303 732a201
better shared file loader config
kumar303 19d7e96
mime types are inferred so this can DRY up even more
kumar303 8ec66ce
move devServer configuration to dev config file
kumar303 3eb2ff6
update yarn.lock
kumar303 eb720de
Replaced sri-stats-webpack-plugin with webpack-subresource-integrity
kumar303 cec2440
Merge branch 'master' into webpack2-iss1761
kumar303 5ac680f
update yarn.lock
kumar303 e3f3895
Simplify SriDataPlugin
kumar303 ee7faab
removing comment, uplift looks unlikely
kumar303 12d0079
document progress so far on running production mode locally
kumar303 6291206
Merge branch 'master' into webpack2-iss1761
kumar303 0f3865e
Better docs for running a local production build
kumar303 69f3e4d
Allow local-production* config files
kumar303 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
// This is a webpack plugin to expose the data generated by SriPlugin. | ||
// See webpack.prod.config.babel.js | ||
import fs from 'fs'; | ||
|
||
import { oneLine } from 'common-tags'; | ||
|
||
export default class SriDataPlugin { | ||
constructor({ saveAs } = {}) { | ||
if (!saveAs) { | ||
throw new Error('The saveAs parameter cannot be empty'); | ||
} | ||
this.saveAs = saveAs; | ||
} | ||
|
||
apply(compiler) { | ||
compiler.plugin('done', (stats) => { | ||
const sriStats = {}; | ||
try { | ||
Object.keys(stats.compilation.assets).forEach((baseName) => { | ||
const asset = stats.compilation.assets[baseName]; | ||
if (!asset.integrity) { | ||
throw new Error( | ||
oneLine`The integrity property is falsey for | ||
asset ${baseName}; Is the webpack-subresource-integrity | ||
plugin installed and enabled?`); | ||
} | ||
sriStats[baseName] = asset.integrity; | ||
}); | ||
|
||
fs.writeFileSync(this.saveAs, JSON.stringify(sriStats)); | ||
} catch (error) { | ||
stats.compilation.errors.push(error); | ||
} | ||
}); | ||
} | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the shared
getPlugins()
array, theprocess.env.NODE_ENV
value is added toDefinePlugin
unlike before. This doesn't seem to cause any problems though.