Skip to content

Instantly share code, notes, and snippets.

@huang-xiao-jian
Created June 1, 2018 07:01
Show Gist options
  • Save huang-xiao-jian/a99731edc90475f921207c902dcd2a4a to your computer and use it in GitHub Desktop.
Save huang-xiao-jian/a99731edc90475f921207c902dcd2a4a to your computer and use it in GitHub Desktop.
webpack 开发服务器配置
/**
* @description - development configuration
* @author - yang.yuncai <383235388@qq.com>
*/
// dependency
const presets = require('@coco-platform/webpack-preset');
const convert = require('koa-connect');
const history = require('connect-history-api-fallback');
const proxy = require('http-proxy-middleware');
// scope
const options = {
entry: 'src/main.jsx',
};
module.exports = presets.development(options);
module.exports.serve = {
add: (app) => {
app.use(convert(proxy('/story', { target: 'https://story.babycherry.cn' })));
app.use(convert(history()));
},
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment