Skip to content

Commit

Permalink
fix(SideEffectsFlag): Allow "false" and false
Browse files Browse the repository at this point in the history
webpack#6074

Slightly modifies `SideEffectsFlagPlugin` to consider the string
`"false"` to be a valid input, whereas it previously only allowed for
the boolean `false`.
  • Loading branch information
Cody Welsh committed Dec 6, 2017
1 parent f3fdd26 commit 3d31e33
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/optimize/SideEffectsFlagPlugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class SideEffectsFlagPlugin {
const resolveData = data.resourceResolveData;
if(resolveData && resolveData.descriptionFileData && resolveData.relativePath) {
const sideEffects = resolveData.descriptionFileData.sideEffects;
const isSideEffectFree = sideEffects === false; // TODO allow more complex expressions
const isSideEffectFree = (sideEffects === false || sideEffects === "false");
if(isSideEffectFree) {
module.sideEffectFree = true;
}
Expand Down

0 comments on commit 3d31e33

Please sign in to comment.