webpack/lib/dependencies/CommonJsInHarmonyWarning.js

19 lines
563 B
JavaScript
Raw Normal View History

/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
2017-01-10 13:00:03 +08:00
"use strict";
module.exports = class CommonJsInHarmonyWarning extends Error {
constructor(name) {
super();
2017-01-10 13:00:03 +08:00
if(Error.hasOwnProperty("captureStackTrace")) {
Error.captureStackTrace(this, this.constructor);
}
this.name = "CommonJsInHarmonyWarning";
this.message = `${name} is not allowed in EcmaScript module: This module was detected as EcmaScript module (import or export syntax was used). In such a module using '${name}' is not allowed.`;
}
2017-01-11 17:51:58 +08:00
};