Angular 在固定目标的情况下跳过 polyfill 的提示 (Chrome 67)
Angular tips to skip polyfills in case of a fixed target (Chrome 67)
我正在做一个 Angular 6 项目。
我的目标非常具体 (Chrome 67),那么有什么技巧可以排除其他目标浏览器所需的所有可能的 polyfill 吗?
- 我可以将 tsconfig 文件中的目标属性切换为 es6 吗?
- 我可以从依赖项中删除 core-js 库吗?
谢谢!
Could I switch my target prop in the tsconfig file to es6 ?
是的。
Could I remove the core-js library from my dependencies?
我相信这个库只能由 polyfills.ts
文件导入。如果您注释掉 polyfill.ts
中的所有行,则无需将其从 package.json
中删除。 WebPack 不会包含该库,除非它被引用。
My target is really specific (Chrome 67), so are there any tips in order to exclude all the possible polyfills needed to other target browsers?
如果您仅使用chrome 67,您可以设置target: es6
并移除对core-js
的依赖。
我正在做一个 Angular 6 项目。
我的目标非常具体 (Chrome 67),那么有什么技巧可以排除其他目标浏览器所需的所有可能的 polyfill 吗?
- 我可以将 tsconfig 文件中的目标属性切换为 es6 吗?
- 我可以从依赖项中删除 core-js 库吗?
谢谢!
Could I switch my target prop in the tsconfig file to es6 ?
是的。
Could I remove the core-js library from my dependencies?
我相信这个库只能由 polyfills.ts
文件导入。如果您注释掉 polyfill.ts
中的所有行,则无需将其从 package.json
中删除。 WebPack 不会包含该库,除非它被引用。
My target is really specific (Chrome 67), so are there any tips in order to exclude all the possible polyfills needed to other target browsers?
如果您仅使用chrome 67,您可以设置target: es6
并移除对core-js
的依赖。