|
Last change
on this file was 9af201e, checked in by MBK <marija.karapandzova@…>, 11 days ago |
|
Fix frontend appearance
|
-
Property mode
set to
100644
|
|
File size:
1.1 KB
|
| Line | |
|---|
| 1 | /*
|
|---|
| 2 | MIT License http://www.opensource.org/licenses/mit-license.php
|
|---|
| 3 | Author Tobias Koppers @sokra
|
|---|
| 4 | */
|
|---|
| 5 |
|
|---|
| 6 | "use strict";
|
|---|
| 7 |
|
|---|
| 8 | const WebpackError = require("./errors/WebpackError");
|
|---|
| 9 |
|
|---|
| 10 | class NoModeWarning extends WebpackError {
|
|---|
| 11 | constructor() {
|
|---|
| 12 | super();
|
|---|
| 13 |
|
|---|
| 14 | /** @type {string} */
|
|---|
| 15 | this.name = "NoModeWarning";
|
|---|
| 16 | this.message =
|
|---|
| 17 | "configuration\n" +
|
|---|
| 18 | "The 'mode' option has not been set, webpack will fallback to 'production' for this value.\n" +
|
|---|
| 19 | "Set 'mode' option to 'development' or 'production' to enable defaults for each environment.\n" +
|
|---|
| 20 | "You can also set it to 'none' to disable any default behavior. " +
|
|---|
| 21 | "Learn more: https://webpack.js.org/configuration/mode/";
|
|---|
| 22 | }
|
|---|
| 23 | }
|
|---|
| 24 |
|
|---|
| 25 | /** @typedef {import("./Compiler")} Compiler */
|
|---|
| 26 |
|
|---|
| 27 | const PLUGIN_NAME = "WarnNoModeSetPlugin";
|
|---|
| 28 |
|
|---|
| 29 | class WarnNoModeSetPlugin {
|
|---|
| 30 | /**
|
|---|
| 31 | * Applies the plugin by registering its hooks on the compiler.
|
|---|
| 32 | * @param {Compiler} compiler the compiler instance
|
|---|
| 33 | * @returns {void}
|
|---|
| 34 | */
|
|---|
| 35 | apply(compiler) {
|
|---|
| 36 | compiler.hooks.thisCompilation.tap(PLUGIN_NAME, (compilation) => {
|
|---|
| 37 | compilation.warnings.push(new NoModeWarning());
|
|---|
| 38 | });
|
|---|
| 39 | }
|
|---|
| 40 | }
|
|---|
| 41 |
|
|---|
| 42 | module.exports = WarnNoModeSetPlugin;
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.