-
Joe Lencioni authored
This ES modules build will make these modules smaller in the final bundles, since the way Babel compiles import to require is pretty verbose. Additionally, it will enable webpack to make some optimizations on the final bundle, including tree-shaking and scope hoisting (if enabled). These will improve bundle sizes and runtime performance. I considered adding a module field to the package.json to point to this version for folks who are able to use it, but I decided to wait on that for now since that is still pretty experimental. For now, consumers will need to use this either by importing from react-dates/esm directly or by using something like a webpack alias to use this version of the build. When working on this I originally kept the plugins array at the top level instead of repeating it for each env, but I ran into an issue that seemed related to ordering that caused babel-register in the compile CSS script to not apply the correct transformations. I was able to work around this by repeating the plugins for each env.
Joe Lencioni authoredThis ES modules build will make these modules smaller in the final bundles, since the way Babel compiles import to require is pretty verbose. Additionally, it will enable webpack to make some optimizations on the final bundle, including tree-shaking and scope hoisting (if enabled). These will improve bundle sizes and runtime performance. I considered adding a module field to the package.json to point to this version for folks who are able to use it, but I decided to wait on that for now since that is still pretty experimental. For now, consumers will need to use this either by importing from react-dates/esm directly or by using something like a webpack alias to use this version of the build. When working on this I originally kept the plugins array at the top level instead of repeating it for each env, but I ran into an issue that seemed related to ordering that caused babel-register in the compile CSS script to not apply the correct transformations. I was able to work around this by repeating the plugins for each env.