From 2d8bf888a9dbb72c05d49e5587173f6284520e44 Mon Sep 17 00:00:00 2001 From: soupette Date: Tue, 24 Sep 2019 14:10:57 +0200 Subject: [PATCH] Remove webpackbar when developing in the admin gto have better logs --- packages/strapi-admin/index.js | 10 ++++++++-- packages/strapi-admin/webpack.config.js | 6 ++++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/packages/strapi-admin/index.js b/packages/strapi-admin/index.js index 25c2095b83..00fe71c895 100644 --- a/packages/strapi-admin/index.js +++ b/packages/strapi-admin/index.js @@ -3,6 +3,7 @@ const fs = require('fs-extra'); const webpack = require('webpack'); const getWebpackConfig = require('./webpack.config.js'); const WebpackDevServer = require('webpack-dev-server'); +const chalk = require('chalk'); const getPkgPath = name => path.dirname(require.resolve(`${name}/package.json`)); @@ -176,7 +177,6 @@ async function build({ dir, env, options }) { } async function watch({ dir, port, options }) { - console.log('Starting the dev web server...'); const entry = path.join(dir, '.cache', 'admin', 'src', 'app.js'); const dest = path.join(dir, 'build'); const env = 'development'; @@ -185,10 +185,12 @@ async function watch({ dir, port, options }) { entry, dest, env, + port, options, }; const opts = { + clientLogLevel: 'silent', hot: true, quiet: true, publicPath: '/admin/', @@ -204,7 +206,11 @@ async function watch({ dir, port, options }) { console.log(err); } - console.log('Admin available at:', `http://localhost:${port}/admin`); + console.log(chalk.green('Starting the development server...')); + console.log(); + console.log( + chalk.green(`Admin development at http://localhost:${port}/admin`) + ); }); } diff --git a/packages/strapi-admin/webpack.config.js b/packages/strapi-admin/webpack.config.js index 45c6f2d2fd..2efe917d58 100644 --- a/packages/strapi-admin/webpack.config.js +++ b/packages/strapi-admin/webpack.config.js @@ -37,12 +37,15 @@ module.exports = ({ filename: '[name].[chunkhash].css', chunkFilename: '[name].[chunkhash].chunkhash.css', }), + new WebpackBar(), ] : [ new DuplicatePckgChecker({ verbose: true, }), - new FriendlyErrorsWebpackPlugin(), + new FriendlyErrorsWebpackPlugin({ + clearConsole: false, + }), ]; const scssLoader = isProduction @@ -237,7 +240,6 @@ module.exports = ({ mainFields: ['browser', 'jsnext:main', 'main'], }, plugins: [ - new WebpackBar(), new HtmlWebpackPlugin({ inject: true, template: path.resolve(__dirname, 'index.html'),