We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
sideEffects
我的项目使用了 monorepos 模式,然后今天发现了一个现象。
项目结构大致如下:
root/ apps/my-app index.js packages/my-package index.js package.json
my-package/index.js 代码如下:
my-package/index.js
console.log('my-package 入口') export { someFn }
且 my-package/package.json 里加入了 sideEffects: false。
sideEffects: false
my-app/index.js 代码如下:
import { someFn } from '@inner-pkg/my-package'
然后用 Webpack 的 dev 模式打包了 my-app/index.js,结果发现控制台没有 my-package/index.js 里的日志消息。
另外,编辑 package.json 里的 sideEffects 选项后,webpack --watch 并没有重新编译代码,需要完全重启 webpack 才能生效。
webpack --watch
The text was updated successfully, but these errors were encountered:
No branches or pull requests
我的项目使用了 monorepos 模式,然后今天发现了一个现象。
项目结构大致如下:
my-package/index.js
代码如下:且 my-package/package.json 里加入了
sideEffects: false
。my-app/index.js 代码如下:
然后用 Webpack 的 dev 模式打包了 my-app/index.js,结果发现控制台没有 my-package/index.js 里的日志消息。
The text was updated successfully, but these errors were encountered: