mirror of
https://github.com/facebook/docusaurus.git
synced 2025-06-07 13:22:26 +02:00
chore: remove unused package
This commit is contained in:
parent
a4c8507a25
commit
8cbd23d690
4 changed files with 233 additions and 56 deletions
19
lib/dev.js
19
lib/dev.js
|
@ -1,17 +1,14 @@
|
|||
const ora = require('ora');
|
||||
const path = require('path');
|
||||
const fs = require('fs-extra');
|
||||
const chalk = require('chalk');
|
||||
const webpack = require('webpack');
|
||||
const chokidar = require('chokidar');
|
||||
const serve = require('webpack-serve');
|
||||
const webpackNiceLog = require('webpack-nicelog');
|
||||
const load = require('./loader');
|
||||
const createDevConfig = require('./webpack/dev');
|
||||
const blogiLog = require('./webpack/log');
|
||||
|
||||
module.exports = async function dev(sourceDir, cliOptions = {}) {
|
||||
const logger = ora(chalk.blue('Starting development server')).start();
|
||||
|
||||
// load site props from preprocessed files in source directory
|
||||
const props = await load(sourceDir);
|
||||
|
||||
|
@ -37,17 +34,21 @@ module.exports = async function dev(sourceDir, cliOptions = {}) {
|
|||
const port = cliOptions.port || 8080;
|
||||
const {publicPath} = props;
|
||||
|
||||
config.plugin('blogi-log').use(blogiLog, [
|
||||
config.plugin('WebpackNiceLog').use(webpackNiceLog, [
|
||||
{
|
||||
port,
|
||||
publicPath
|
||||
onDone: () => {
|
||||
console.log(
|
||||
`\n${chalk.blue('Development server available at ')}${chalk.cyan(
|
||||
`http://localhost:${port}${publicPath}`
|
||||
)}`
|
||||
);
|
||||
}
|
||||
}
|
||||
]);
|
||||
|
||||
// create compiler from generated webpack config
|
||||
config = config.toConfig();
|
||||
const compiler = webpack(config);
|
||||
logger.succeed();
|
||||
|
||||
// webpack-serve
|
||||
await serve(
|
||||
|
@ -56,7 +57,7 @@ module.exports = async function dev(sourceDir, cliOptions = {}) {
|
|||
compiler,
|
||||
open: false, // don't open browser automatically
|
||||
devMiddleware: {
|
||||
logLevel: 'warn',
|
||||
logLevel: 'silent',
|
||||
publicPath
|
||||
},
|
||||
hotClient: {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue