mirror of
https://github.com/strapi/strapi.git
synced 2025-07-20 23:47:46 +00:00
Remove webpackbar when developing in the admin gto have better logs
This commit is contained in:
parent
d186d14721
commit
2d8bf888a9
@ -3,6 +3,7 @@ const fs = require('fs-extra');
|
|||||||
const webpack = require('webpack');
|
const webpack = require('webpack');
|
||||||
const getWebpackConfig = require('./webpack.config.js');
|
const getWebpackConfig = require('./webpack.config.js');
|
||||||
const WebpackDevServer = require('webpack-dev-server');
|
const WebpackDevServer = require('webpack-dev-server');
|
||||||
|
const chalk = require('chalk');
|
||||||
|
|
||||||
const getPkgPath = name =>
|
const getPkgPath = name =>
|
||||||
path.dirname(require.resolve(`${name}/package.json`));
|
path.dirname(require.resolve(`${name}/package.json`));
|
||||||
@ -176,7 +177,6 @@ async function build({ dir, env, options }) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async function watch({ dir, port, 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 entry = path.join(dir, '.cache', 'admin', 'src', 'app.js');
|
||||||
const dest = path.join(dir, 'build');
|
const dest = path.join(dir, 'build');
|
||||||
const env = 'development';
|
const env = 'development';
|
||||||
@ -185,10 +185,12 @@ async function watch({ dir, port, options }) {
|
|||||||
entry,
|
entry,
|
||||||
dest,
|
dest,
|
||||||
env,
|
env,
|
||||||
|
port,
|
||||||
options,
|
options,
|
||||||
};
|
};
|
||||||
|
|
||||||
const opts = {
|
const opts = {
|
||||||
|
clientLogLevel: 'silent',
|
||||||
hot: true,
|
hot: true,
|
||||||
quiet: true,
|
quiet: true,
|
||||||
publicPath: '/admin/',
|
publicPath: '/admin/',
|
||||||
@ -204,7 +206,11 @@ async function watch({ dir, port, options }) {
|
|||||||
console.log(err);
|
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`)
|
||||||
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -37,12 +37,15 @@ module.exports = ({
|
|||||||
filename: '[name].[chunkhash].css',
|
filename: '[name].[chunkhash].css',
|
||||||
chunkFilename: '[name].[chunkhash].chunkhash.css',
|
chunkFilename: '[name].[chunkhash].chunkhash.css',
|
||||||
}),
|
}),
|
||||||
|
new WebpackBar(),
|
||||||
]
|
]
|
||||||
: [
|
: [
|
||||||
new DuplicatePckgChecker({
|
new DuplicatePckgChecker({
|
||||||
verbose: true,
|
verbose: true,
|
||||||
}),
|
}),
|
||||||
new FriendlyErrorsWebpackPlugin(),
|
new FriendlyErrorsWebpackPlugin({
|
||||||
|
clearConsole: false,
|
||||||
|
}),
|
||||||
];
|
];
|
||||||
|
|
||||||
const scssLoader = isProduction
|
const scssLoader = isProduction
|
||||||
@ -237,7 +240,6 @@ module.exports = ({
|
|||||||
mainFields: ['browser', 'jsnext:main', 'main'],
|
mainFields: ['browser', 'jsnext:main', 'main'],
|
||||||
},
|
},
|
||||||
plugins: [
|
plugins: [
|
||||||
new WebpackBar(),
|
|
||||||
new HtmlWebpackPlugin({
|
new HtmlWebpackPlugin({
|
||||||
inject: true,
|
inject: true,
|
||||||
template: path.resolve(__dirname, 'index.html'),
|
template: path.resolve(__dirname, 'index.html'),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user