chore: sync with verdaccio master

This commit is contained in:
Juan Picado @jotadeveloper
2019-04-04 21:23:40 +02:00
parent 133a5f0171
commit 3506f32ad8
241 changed files with 57691 additions and 1932 deletions

View File

@@ -1,23 +1,21 @@
import path from "path";
import webpack from "webpack";
import WebpackDevServer from "webpack-dev-server";
import config from "./webpack.dev.config.babel";
import ora from "ora";
const DIST_PATH = path.resolve(__dirname, "../static/");
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.hooks.done.tap("Verdaccio Dev Server", () => {
const spinner = ora('Compiler is running...').start();
compiler.hooks.done.tap('Verdaccio Dev Server', () => {
if (!global.rebuild) {
spinner.stop();
console.log("Dev Server Listening at http://localhost:4872/");
console.log('Dev Server Listening at http://localhost:4872/');
global.rebuild = true;
}
});
new WebpackDevServer(compiler, {
contentBase: `${DIST_PATH}`,
contentBase: `${env.DIST_PATH}`,
publicPath: config.output.publicPath,
hot: true,
historyApiFallback: true,
@@ -30,19 +28,13 @@ new WebpackDevServer(compiler, {
hash: true,
timings: true,
chunks: true,
chunkModules: false
chunkModules: false,
},
proxy: [
{
context: [
"/-/verdaccio/logo",
"/-/verdaccio/packages",
"/-/static/logo.png"
],
target: "http://localhost:4873"
}
]
}).listen(4872, "localhost", function(err) {
proxy: [{
context: ['/-/verdaccio/logo', '/-/verdaccio/packages', '/-/static/logo.png'],
target: 'http://localhost:4873',
}],
}).listen(4872, 'localhost', function(err) {
if (err) {
return console.log(err);
}