# noCli_Webpack **Repository Path**: post-man/no-cli_-webpack ## Basic Information - **Project Name**: noCli_Webpack - **Description**: 不使用脚手架,搭建项目,配置webpack打包项目。 - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2022-03-01 - **Last Updated**: 2023-02-28 ## Categories & Tags **Categories**: Uncategorized **Tags**: webpack ## README ### 参考 https://www.jianshu.com/p/bfd5ec1c1ca7 ### babel babel 在转译的过程中,对 syntax 的处理可能会使用到 helper 函数,对 api 的处理会引入 polyfill。 默认情况下,babel 在每个需要使用 helper 的地方都会定义一个 helper,导致最终的产物里有大量重复的 helper;引入 polyfill 时会直接修改全局变量及其原型,造成原型污染。 @babel/plugin-transform-runtime 的作用是将 helper 和 polyfill 都改为从一个统一的地方引入,并且引入的对象和全局变量是完全隔离的,这样解决了上面的两个问题。 ### 打包 npm run start --prepub npm run build --pro