Skip to content

Commit f65a24d

Browse files
committed
move warning into separate file
1 parent 9528aa5 commit f65a24d

File tree

2 files changed

+23
-14
lines changed

2 files changed

+23
-14
lines changed

lib/CommentCompilationWarning.js

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
/*
2+
MIT License http://www.opensource.org/licenses/mit-license.php
3+
Author Tobias Koppers @sokra
4+
*/
5+
"use strict";
6+
7+
const WebpackError = require("./WebpackError");
8+
9+
class CommentCompilationWarning extends WebpackError {
10+
constructor(message, module, loc) {
11+
super(message);
12+
13+
this.name = "CommentCompilationWarning";
14+
15+
this.module = module;
16+
this.loc = loc;
17+
18+
Error.captureStackTrace(this, this.constructor);
19+
}
20+
}
21+
22+
module.exports = CommentCompilationWarning;

lib/dependencies/ImportParserPlugin.js

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ const ImportDependenciesBlock = require("./ImportDependenciesBlock");
1010
const ImportEagerDependency = require("./ImportEagerDependency");
1111
const ContextDependencyHelpers = require("./ContextDependencyHelpers");
1212
const UnsupportedFeatureWarning = require("../UnsupportedFeatureWarning");
13-
const WebpackError = require("../WebpackError");
13+
const CommentCompilationWarning = require("../CommentCompilationWarning");
1414

1515
class ImportParserPlugin {
1616
constructor(options) {
@@ -260,17 +260,4 @@ class ImportParserPlugin {
260260
}
261261
}
262262

263-
class CommentCompilationWarning extends WebpackError {
264-
constructor(message, module, loc) {
265-
super(message);
266-
267-
this.name = "CommentCompilationWarning";
268-
269-
this.module = module;
270-
this.loc = loc;
271-
272-
Error.captureStackTrace(this, this.constructor);
273-
}
274-
}
275-
276263
module.exports = ImportParserPlugin;

0 commit comments

Comments
 (0)