Skip to content

Commit

Permalink
chore: update to webpack v5
Browse files Browse the repository at this point in the history
  • Loading branch information
evenstensberg committed Nov 12, 2019
1 parent 1d9c2bc commit e59bcd7
Show file tree
Hide file tree
Showing 5 changed files with 263 additions and 161 deletions.
18 changes: 14 additions & 4 deletions lib/utils/compiler.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,10 +111,20 @@ function generateOutputForSingleCompilation(statsObj, statsErrors, processingMes
});
}

warnings.forEach(warning => {
process.stdout.write('\n\n');
process.cliLogger.warn(warning);
});
if (warnings) {
warnings.forEach(warning => {
process.stdout.write('\n\n');

if (warning.message) {
process.cliLogger.warn(warning.message);
process.stdout.write('\n');
process.cliLogger.warn(warning.stack);
return;
}
process.cliLogger.warn(warning);
});
process.stdout.write('\n');
}

if (statsErrors) {
statsErrors.forEach(err => {
Expand Down
2 changes: 0 additions & 2 deletions lib/utils/development-config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
const { join, resolve } = require('path');
const TerserPlugin = require('terser-webpack-plugin');
const JsConfigWebpackPlugin = require('js-config-webpack-plugin');

const defaultOutputPath = resolve(join(process.cwd(), 'dist'));

Expand All @@ -11,7 +10,6 @@ module.exports = () => ({
path: defaultOutputPath,
filename: 'bundle.js',
},
plugins: [new JsConfigWebpackPlugin()],

optimization: {
minimizer: [
Expand Down
2 changes: 0 additions & 2 deletions lib/utils/production-config.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
const { join, resolve } = require('path');
const TerserPlugin = require('terser-webpack-plugin');
const JsConfigWebpackPlugin = require('js-config-webpack-plugin');

const defaultOutputPath = resolve(join(process.cwd(), 'dist'));

module.exports = (options, outputOptions) => ({
mode: 'production',
entry: './index.js',
plugins: [new JsConfigWebpackPlugin()],
output: {
path: defaultOutputPath,
filename: 'bundle.js',
Expand Down
Loading

0 comments on commit e59bcd7

Please sign in to comment.