0
Fork 0
mirror of https://github.com/verdaccio/verdaccio.git synced 2024-12-16 21:56:25 -05:00
verdaccio/packages/plugins/ui-theme/tools/dev.server.js
Andreas Opferkuch 5b3903963a
fix: improve mobile styles (#3077)
* fix: improve mobile styles

* chore: clarify changeset requirements

* chore: add changeset
2022-03-21 23:12:09 +01:00

47 lines
1 KiB
JavaScript

import ora from 'ora';
import webpack from 'webpack';
import WebpackDevServer from 'webpack-dev-server';
import env from '../config/env';
import config from './webpack.dev.config.babel';
const compiler = webpack(config);
const spinner = ora('Compiler is running...').start();
const port = 4873;
compiler.hooks.done.tap('Verdaccio Dev Server', () => {
if (!global.rebuild) {
spinner.stop();
console.log(`Dev Server Listening at http://localhost:${port}/`);
global.rebuild = true;
}
});
new WebpackDevServer(compiler, {
contentBase: env.DIST_PATH,
publicPath: config.output.publicPath,
hot: true,
historyApiFallback: {
disableDotRule: true,
},
quiet: true,
noInfo: false,
stats: {
assets: false,
colors: true,
version: true,
hash: true,
timings: true,
chunks: true,
chunkModules: false,
},
proxy: [
{
context: ['/-/verdaccio/**', '**/*.tgz'],
target: 'http://localhost:8000',
},
],
}).listen(port, '0.0.0.0', function (err) {
if (err) {
return console.log(err);
}
});