Skip to content

Commit 96b4e1d

Browse files
committed
Rewrite path with historyapifallback to ./demo
1 parent 2c0b79a commit 96b4e1d

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

webpack/config.js

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -49,15 +49,13 @@ if (ENV === 'development') {
4949
plugins: [],
5050

5151
devServer: {
52-
// contentBase: path.join(__dirname, '../demo/'),
5352
historyApiFallback: {
5453
rewrites: [
5554
{ from: /^\/$/, to: '/demo/index.html' },
56-
{ from: /\/index\.html$/, to: '/demo/index.html' },
57-
{ from: /\/css\/style\.css$/, to: '/demo/css/style.css' },
58-
{ from: /\/css\/bootstrap\.css$/, to: '/demo/css/bootstrap.css' },
59-
{ from: /\/serviceDatasource\/serviceDatasource\.html$/, to: '/demo/serviceDatasource/serviceDatasource.html' },
60-
{ from: /\/serviceDatasource\/serviceDatasource\.js$/, to: '/demo/serviceDatasource/serviceDatasource.js' }
55+
{ from: /\/ui-scroll-demo\.gif$/, to: '/demo/ui-scroll-demo.gif' },
56+
{ from: /\/*\/*\.html$/, to: (context) => '/demo' + context.parsedUrl.pathname },
57+
{ from: /\/*\/*\.css$/, to: (context) => '/demo' + context.parsedUrl.pathname },
58+
{ from: /\/*\/*\.js$/, to: (context) => '/demo' + context.parsedUrl.pathname }
6159
]
6260
},
6361
inline: true,

0 commit comments

Comments
 (0)