方法一,在开发过程中配置:
1.在src下的index.html中,删除<base href="/">;
2.配置tsconfig.json,找到target设置为es5;
"target": "es5"
方法二,在打包后dist中配置:
在生成的dist目录下,做以下操作:
1.在index.html中删除 <base href="/">;
2.在index.html中删除所有 script 的 type="module"属性。
1.在src下的index.html中,删除<base href="/">;
2.配置tsconfig.json,找到target设置为es5;
"target": "es5"
在生成的dist目录下,做以下操作:
1.在index.html中删除 <base href="/">;
2.在index.html中删除所有 script 的 type="module"属性。