Created
June 1, 2018 07:01
-
-
Save huang-xiao-jian/a99731edc90475f921207c902dcd2a4a to your computer and use it in GitHub Desktop.
webpack 开发服务器配置
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @description - development configuration | |
* @author - yang.yuncai <[email protected]> | |
*/ | |
// 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