Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ module.exports = function loader (css, map, meta) {
return postcss(plugins)
.process(css, options)
.then((result) => {
result.warnings().forEach((msg) => this.emitWarning(msg.toString()))
result.warnings().forEach((msg) => this.emitWarning(new Error(msg.toString())))
Copy link
Member

@michael-ciniawsky michael-ciniawsky Jul 9, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I need to check the Postcss API docs, but I think warnings can contain location info and a code frame if the plugin author used the appropiated PostCSS Plugin API. If that's the case it would be better to reuse the code located in lib/Error.js and create a new class LoaderWarning (lib/Warning.js) based upon that to be consistent in terms of formatting


result.messages.forEach((msg) => {
if (msg.type === 'dependency') this.addDependency(msg.file)
Expand Down