-
Notifications
You must be signed in to change notification settings - Fork 512
refactor: don't throw errors in case of child context #390
Conversation
will work with this conditional webpack rule: ```js { test: /\.scss$/, oneOf: [ {test: /html-webpack-plugin/, use: "null-loader"}, { use: ExtractTextPlugin.extract({ fallbackLoader: 'style-loader', loader: ['css-loader', 'sass-loader'] }) } ] }, ```
Codecov Report
@@ Coverage Diff @@
## master #390 +/- ##
==========================================
+ Coverage 87.06% 87.28% +0.21%
==========================================
Files 5 5
Lines 348 346 -2
Branches 71 70 -1
==========================================
- Hits 303 302 -1
+ Misses 45 44 -1
Continue to review full report at Codecov.
|
i signed to CLA but it wont show up here... |
Yeah, the CLA checker is currently disabled. No need to worry about that. I think we have to wait on @sokra on whether this is a good idea or not. It would fix your use case, but make it easier to miss the connection. |
yeah i know...but the line below returned an empty string without throwing in case of a child context...so i thought i would be ok to fail silent |
Maybe a warning would be a softer approach. At worst case we'll add a flag for disabling the error. But it's Tobias' call to make. |
@digitalkaoz What is your particular usecase for this? In any case, please close and reopen the PR to trigger CLA Bot again and sign to CLA We definitely need at least to |
'refer to https://github.com/webpack/extract-text-webpack-plugin for the usage example' | ||
); | ||
} else if(this[NS] === false) { | ||
if(this[NS] === undefined || this[NS] === false) { | ||
return ""; |
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.
this.emitWarning(`
The extract-text-webpack-plugin loader is used without the corresponding plugin,
in case this is unintentional refer to https://github.com/webpack/extract-text-webpack-plugin
for correct usage (example)
`)
Or similiar 😛
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.
Should probably emit here no? ( Ha, finally got to not be on the receiving end of console.warn
hand slap! )
In any case, this needs to do something. The black hole approach is less than optimal for consumers, particularly those lacking a deep understanding of what extract text is doing contextually.
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.
good catch, yep this.emitWarning
😛, example updated ☝️
Any updates on this? |
@digitalkaoz friendly ping |
We are close the a major release, currently in |
will work with this conditional webpack rule (in conjunction with html-webpack-loader):