Skip to content
This repository has been archived by the owner on Mar 7, 2024. It is now read-only.

Commit

Permalink
fix(web): 修复开发模式下 browser history 不能直接打开路由的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
Darmody committed Sep 11, 2020
1 parent e4e7e84 commit 1d6a910
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions packages/remax-cli/src/build/webpack/config.web.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,16 +129,17 @@ export default function webpackConfig(api: API, options: Options): webpack.Confi

api.configWebpack(context);

const devServer = config.get('devServer');
const devServer = config.get('devServer') || {};

config.set('devServer', {
publicPath,
compress: true,
hot: true,
open: false,
historyApiFallback: true,
noInfo: true,
...devServer,
config.devServer.publicPath(publicPath);
config.devServer.compress(true);
config.devServer.hot(true);
config.devServer.open(false);
config.devServer.historyApiFallback(true);
config.devServer.noInfo(true);

Object.keys(devServer).forEach(key => {
config.devServer.set(key, devServer[key]);
});

return config.toConfig();
Expand Down

1 comment on commit 1d6a910

@vercel
Copy link

@vercel vercel bot commented on 1d6a910 Sep 11, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.