question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Outdated webpack documentation

See original GitHub issue

It seems like the webpack documentation is currently out of date.

For one, it references a locale, which was available in pre v2 versions of date-fns (the en locale to be specific).

Furthermore, post v2 date-fns locales now contain .d.ts and .md files, which make the documented ContextReplacementPlugin spit out a nasty warning:

image

P.S. I’d like to end this issue with thanking all the contributors for maintaining this package, it has been really useful on the project I am working on. I hope it gets picked up by more developers!

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:1
  • Comments:11 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
oneMoreTime1357commented, Dec 23, 2021

not work for me. webpack5

new webpack.ContextReplacementPlugin(
  /date\-fns[\/\\]/,
  new RegExp(`[/\\\\\](${supportedLocales.join('|')})[/\\\\\]index\.js$`)
 )

params is wrong

new webpack.ContextReplacementPlugin(
  resourceRegExp: RegExp,
  newContentResource: string,
  newContentCreateContextMap: object // mapping runtime-request (userRequest) to compile-time-request (request)
);

webpack plugin link https://webpack.js.org/plugins/context-replacement-plugin/

1reaction
taco-tues-on-a-fricommented, Jun 18, 2020

@psimk 's solution fixed my issue with webpack throwing errors from the .js.flow & .md files that were also getting included in the dynamic import of locales. The change included in his pull request would be an immensely helpful addition to the documentation.

new webpack.ContextReplacementPlugin(
  /date\-fns[\/\\]/,
  new RegExp(`[/\\\\\](${supportedLocales.join('|')})[/\\\\\]index\.js$`)
 )
Read more comments on GitHub >

github_iconTop Results From Across the Web

To v5 from v4 - webpack
Upgrade webpack 4 and its plugins/loaders · Make sure your build has no errors or warnings · Make sure to use mode ·...
Read more >
outdated-browser-webpack-plugin - npm
Start using outdated-browser-webpack-plugin in your project by running `npm i outdated-browser-webpack-plugin`. There are no other projects ...
Read more >
webpack-clean-obsolete-chunks: Documentation | Openbase
webpack -clean-obsolete-chunks docs, getting started, code examples, API reference and more.
Read more >
Bundling with webpack - Expo Documentation
If you need to edit the config the best way to do this is by running npx expo customize webpack.config.js . This will...
Read more >
Webpack 5 Migration - Medium
Some of the loaders are deprecated in webpack-5 like url-loader, file-loader and raw-loader. Now we have to migrate on Asset Modules.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found