How to use the WebpackError function from webpack

Find comprehensive JavaScript webpack.WebpackError code examples handpicked from public code repositorys.

173
174
175
176
177
178
179
180
181
182
                        failOnError: false,
                        onDetected: function ({ module: _webpackModuleRecord, paths, compilation }) {
                                if (paths.some(p => p.includes('container.ts'))) return;

                                // @ts-ignore
                                compilation.warnings.push(new WebpackError(paths.join(' -> ')));
                        },
                }),
        );
}
fork icon5
star icon133
watch icon2

57
58
59
60
61
62
63
64
65
66
    })
}

const report = (type, err, compiler) => {
  compiler.hooks.compilation.tap(pluginName, (compilation) => {
    const error = new WebpackError(`${pluginName} - ${err.message}`)

    error.name = 'EnvResolveError'
    compilation[`${type}s`].push(error)
  })
fork icon1
star icon1
watch icon2