Skip to content

Commit

Permalink
fix(options): enable using plugin without defining options (#393)
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinchappell authored and evilebottnawi committed May 10, 2019
1 parent 13e9cbf commit a7dee8c
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 13 deletions.
24 changes: 12 additions & 12 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ class CssModuleFactory {
}

class MiniCssExtractPlugin {
constructor(options) {
constructor(options = {}) {
this.options = Object.assign(
{
filename: DEFAULT_FILENAME,
Expand Down
2 changes: 2 additions & 0 deletions test/cases/default-options/expected/main.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
body { background: red; }

1 change: 1 addition & 0 deletions test/cases/default-options/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
import './style.css';
1 change: 1 addition & 0 deletions test/cases/default-options/style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
body { background: red; }
14 changes: 14 additions & 0 deletions test/cases/default-options/webpack.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import Self from '../../../src';

module.exports = {
entry: './index.js',
module: {
rules: [
{
test: /\.css$/,
use: [Self.loader, 'css-loader'],
},
],
},
plugins: [new Self()],
};

0 comments on commit a7dee8c

Please sign in to comment.