1 Star 0 Fork 1

快易科技 / react主项目-多个子项目-gy

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
server.js 1.79 KB
一键复制 编辑 原始数据 按行查看 历史
jswebh5 提交于 2018-02-25 12:37 . 主项目多个子项目
// This file configures the development web server
// which supports hot reloading and synchronized testing.
// Require Browsersync along with webpack and middleware for it
import browserSync from 'browser-sync';
// Required for react-router browserHistory
// see https://github.com/BrowserSync/browser-sync/issues/204#issuecomment-102623643
import historyApiFallback from 'connect-history-api-fallback';
import webpack from 'webpack';
import webpackDevMiddleware from 'webpack-dev-middleware';
import webpackHotMiddleware from 'webpack-hot-middleware';
import config from './webpack-dev-config';
import webConfig from './webs-config' //项目配置
const bundler = webpack(config);
// Run Browsersync and use middleware for Hot Module Replacement
browserSync({
port: webConfig.port,
ui: {
port: webConfig.port + 1
},
server: {
baseDir: 'src/webs/' + webConfig.name + webConfig.startPath,
middleware: [
historyApiFallback(),
webpackDevMiddleware(bundler, {
// Dev middleware can't access config, so we provide publicPath
publicPath: config.output.publicPath,
// These settings suppress noisy webpack output so only errors are displayed to the console.
noInfo: false,
quiet: false,
stats: {
assets: false,
colors: true,
version: false,
hash: false,
timings: false,
chunks: false,
chunkModules: false
},
// for other settings see
// http://webpack.github.io/docs/webpack-dev-middleware.html
}),
// bundler should be the same as above
webpackHotMiddleware(bundler)
]
},
// no need to watch '*.js' here, webpack will take care of it for us,
// including full page reloads if HMR won't work
files: [
'src/*.html'
]
});
1
https://gitee.com/gdkstock/react_main_project__multiple_sub_projects_gy.git
git@gitee.com:gdkstock/react_main_project__multiple_sub_projects_gy.git
gdkstock
react_main_project__multiple_sub_projects_gy
react主项目-多个子项目-gy
master

搜索帮助

53164aa7 5694891 3bd8fe86 5694891