【发布时间】:2020-08-20 04:47:53
【问题描述】:
我正在尝试理解Webpack DevServer Proxy documentation。
我的目标是将任何没有 .html 的路径代理到相应的 .html 文件。示例:/foo -> /foo.html 和 /bar -> /bar.html
我想,我需要使用pathRewrites。文档示例建议使用pathRewrite: {'^/api' : ''} 重写路径。
我还不清楚(第一个参数的)语法:插入符号 (^) 字符的含义是什么?它是正则表达式吗?语法文档在某处吗?
【问题讨论】:
标签: javascript webpack proxy configuration webpack-dev-server