1 В избранное 0 Ответвления 0

OSCHINA-MIRROR/lxxxl_268-ReactTry

Присоединиться к Gitlife
Откройте для себя и примите участие в публичных проектах с открытым исходным кодом с участием более 10 миллионов разработчиков. Приватные репозитории также полностью бесплатны :)
Присоединиться бесплатно
Клонировать/Скачать
server.js 1.2 КБ
Копировать Редактировать Web IDE Исходные данные Просмотреть построчно История
lx Отправлено 28.02.2017 06:48 8f4cc2d
/*eslint no-console:0 */
'use strict';
require('core-js/fn/object/assign');
const webpack = require('webpack');
const WebpackDevServer = require('webpack-dev-server');
const config = require('./webpack.config');
const open = require('open');
/**
* Flag indicating whether webpack compiled for the first time.
* @type {boolean}
*/
let isInitialCompilation = true;
const compiler = webpack(config);
new WebpackDevServer(compiler, config.devServer)
.listen(config.port, 'localhost', (err) => {
if (err) {
console.log(err);
}
console.log('Listening at localhost:' + config.port);
});
compiler.plugin('done', () => {
if (isInitialCompilation) {
// Ensures that we log after webpack printed its stats (is there a better way?)
setTimeout(() => {
console.log('\n✓ The bundle is now ready for serving!\n');
console.log('🌎 Open in iframe mode:\t\x1b[33m%s\x1b[0m', 'http://localhost:' + config.port + '/webpack-dev-server/');
console.log('🌎 Open in inline mode:\t\x1b[33m%s\x1b[0m', 'http://localhost:' + config.port + '/\n');
console.log(' \x1b[33mHMR is active\x1b[0m. The bundle will automatically rebuild and live-update on changes.')
}, 350);
}
isInitialCompilation = false;
});

Опубликовать ( 0 )

Вы можете оставить комментарий после Вход в систему

1
https://api.gitlife.ru/oschina-mirror/lxxxl_268-ReactTry.git
git@api.gitlife.ru:oschina-mirror/lxxxl_268-ReactTry.git
oschina-mirror
lxxxl_268-ReactTry
lxxxl_268-ReactTry
master