File tree Expand file tree Collapse file tree 2 files changed +33
-7
lines changed
examples/history-api-fallback Expand file tree Collapse file tree 2 files changed +33
-7
lines changed Original file line number Diff line number Diff line change @@ -21,13 +21,41 @@ Usage via CLI:
21
21
npx webpack serve --open --history-api-fallback
22
22
```
23
23
24
- _ Note: some URLs don't work by default. For example; if the url contains a dot.
24
+ ## What Should Happen
25
+
26
+ 1 . The script should open ` http://0.0.0.0:8080/ ` in your default browser.
27
+ 2 . You should see text on the page that reads ` Current Path: / ` .
28
+ 3 . Navigate to ` http://localhost:8080/foo-bar ` .
29
+ 4 . You should see text on the page that reads ` Current Path: /foo-bar ` .
30
+
31
+ _ Note: some URLs don't work by default. For example, if the url contains a dot (` /file.txt ` in this example).
25
32
Be sure to checkout the [ connect-history-api-fallback] ( https://github.com/bripkens/connect-history-api-fallback )
26
33
options._
27
34
35
+ To allow ` /file.txt ` to fallback, update the ` webpack.config.js ` as follows:
36
+
37
+ ** webpack.config.js**
38
+
39
+ ``` js
40
+ module .exports = {
41
+ // ...
42
+ devServer: {
43
+ historyApiFallback: {
44
+ disableDotRule: true ,
45
+ },
46
+ },
47
+ };
48
+ ```
49
+
50
+ Usage via CLI:
51
+
52
+ ``` console
53
+ npx webpack serve --open
54
+ ```
55
+
28
56
## What Should Happen
29
57
30
58
1 . The script should open ` http://0.0.0.0:8080/ ` in your default browser.
31
- 2 . You should see text on the page that reads ' Current Path: /' .
32
- 3 . Navigate to ` http://localhost:8080/foo/bar ` .
33
- 4 . You should see text on the page that reads ' Current Path: /foo/background' .
59
+ 2 . You should see text on the page that reads ` Current Path: / ` .
60
+ 3 . Navigate to ` http://localhost:8080/file.txt ` .
61
+ 4 . You should see text on the page that reads ` Current Path: /file.txt ` .
Original file line number Diff line number Diff line change @@ -8,8 +8,6 @@ module.exports = setup({
8
8
context : __dirname ,
9
9
entry : "./app.js" ,
10
10
devServer : {
11
- historyApiFallback : {
12
- disableDotRule : true ,
13
- } ,
11
+ historyApiFallback : true ,
14
12
} ,
15
13
} ) ;
You can’t perform that action at this time.
0 commit comments