0
Fork 0
mirror of https://github.com/verdaccio/verdaccio.git synced 2024-12-23 22:27:34 -05:00
verdaccio/tools/dev.server.js
Juan Picado @jotadeveloper 3738221bf5
fix: eslint warnings
2017-07-18 21:14:13 +02:00

37 lines
887 B
JavaScript

import webpack from 'webpack';
import WebpackDevServer from 'webpack-dev-server';
import config from './webpack.dev.config.babel';
import ora from 'ora';
import env from '../src/config/env';
const compiler = webpack(config);
const spinner = ora('Compiler is running...').start();
compiler.plugin('done', () => {
if (!global.rebuild) {
spinner.stop();
console.log('Dev Server Listening at http://localhost:4872/');
global.rebuild = true;
}
});
new WebpackDevServer(compiler, {
contentBase: `${env.DIST_PATH}`,
publicPath: config.output.publicPath,
hot: true,
historyApiFallback: true,
quiet: true,
noInfo: false,
stats: {
assets: false,
colors: true,
version: true,
hash: true,
timings: true,
chunks: true,
chunkModules: false,
},
}).listen(4872, 'localhost', function(err) {
if (err) {
return console.log(err);
}
});