Skip to content
New issue

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

Update to webpack v5 #205

Closed
jaydenseric opened this issue Nov 18, 2020 · 3 comments · Fixed by #246
Closed

Update to webpack v5 #205

jaydenseric opened this issue Nov 18, 2020 · 3 comments · Fixed by #246

Comments

@jaydenseric
Copy link
Contributor

jaydenseric commented Nov 18, 2020

We should be optimizing our packages for the most recent version of webpack, which is now v5.

Importantly, it understands the package exports field:

Also, it doesn't automatically polyfill the Node.js process global for the browser. Right now, I'm trying to size-limit test a package containing React component code like this:

// Allow the display name to be eliminated from production bundles.
if (typeof process === 'object' && process.env.NODE_ENV !== 'production')
  Foo.displayName = 'Foo';

Webpack v4 sees the process related code, and inserts a massive ./node_modules/process/browser.js shim that can not be ignored by the size-limit config ignore option, because that shim is added by webpack and is not imported anywhere in the code I'm testing.

@ai
Copy link
Owner

ai commented Nov 18, 2020

Yeap. I like to migrate to webpack 5, but do not have time to do this, since spending all my time with Logux State.

Can you send PR?

@jaydenseric
Copy link
Contributor Author

Logux State 👀

Does only the @size-limit/webpack need work? It seems so running npm ls webpack:

├─┬ @size-limit/preset-small-lib@4.7.0
│ └─┬ @size-limit/webpack@4.7.0
│   ├─┬ css-loader@5.0.1
│   │ └── webpack@4.44.2 deduped
│   ├─┬ file-loader@6.2.0
│   │ └── webpack@4.44.2 deduped
│   ├─┬ optimize-css-assets-webpack-plugin@5.0.4
│   │ └── webpack@4.44.2 deduped
│   ├─┬ style-loader@2.0.0
│   │ └── webpack@4.44.2 deduped
│   └── webpack@4.44.2

@ai
Copy link
Owner

ai commented Nov 18, 2020

Yeap, only @size-limit/webpack

jaydenseric added a commit to jaydenseric/next-server-context that referenced this issue Nov 18, 2020
…on builds.

The size-limit had to be increased because webpack v4 starts to include the browser shim for the Node.js process global. This will not happen in webpack v5 which size-limit doesn’t use yet, see: ai/size-limit#205 .
jaydenseric added a commit to jaydenseric/device-agnostic-ui that referenced this issue Dec 23, 2020
…ew JSX transform.

- Custom Babel plugins now run before and after the styled-jsx/babel plugin, to workaround vercel/styled-jsx#680 and vercel/styled-jsx#689 .
- Temporarily remove size-limit due to ai/size-limit#205 .
@ai ai closed this as completed in #246 Oct 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants