-
-
Notifications
You must be signed in to change notification settings - Fork 622
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Do not create LoaderOptionsPlugin if loaderOptions is empty (#72)
- Loading branch information
1 parent
016ed78
commit 686ad46
Showing
7 changed files
with
45 additions
and
2 deletions.
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
6 changes: 6 additions & 0 deletions
6
lib/transformations/loaderOptionsPlugin/__testfixtures__/loaderOptionsPlugin-0.input.js
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,6 @@ | ||
// Do not create LoaderOptionsPlugin is not necessary | ||
module.exports = { | ||
plugins: [ | ||
new SomePlugin() | ||
] | ||
} |
File renamed without changes.
9 changes: 9 additions & 0 deletions
9
lib/transformations/loaderOptionsPlugin/__testfixtures__/loaderOptionsPlugin-2.input.js
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,9 @@ | ||
// Don't modify LoaderOptionsPlugin | ||
module.exports = { | ||
plugins: [ | ||
new SomePlugin(), | ||
new webpack.optimize.LoaderOptionsPlugin({ | ||
foo: 'bar' | ||
}) | ||
] | ||
} |
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
4 changes: 3 additions & 1 deletion
4
lib/transformations/loaderOptionsPlugin/loaderOptionsPlugin.test.js
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 |
---|---|---|
@@ -1,3 +1,5 @@ | ||
const defineTest = require('../defineTest'); | ||
|
||
defineTest(__dirname, 'loaderOptionsPlugin'); | ||
defineTest(__dirname, 'loaderOptionsPlugin', 'loaderOptionsPlugin-0'); | ||
defineTest(__dirname, 'loaderOptionsPlugin', 'loaderOptionsPlugin-1'); | ||
defineTest(__dirname, 'loaderOptionsPlugin', 'loaderOptionsPlugin-2'); |
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