Closed cristiano-belloni closed 5 years ago
...then we can think about publishing only dist, or publishing src and dist, or changing the index in package.json
The way we're bundling this, it will not be optimised by Webpack. Speaking with @ollyhayes, we have this plan of action to try:
1 - Relax the versions
2 - Have a index.js
importing the whole library, as the main entrypoint
3 - Build the library for commonjs and put it in the lib-commonjs
directory
4 - Point main
in package.json
to lib-common-js
5 - Point module
in package.json
to src
Also, let's take a look at sideEffects
here: https://webpack.js.org/guides/tree-shaking/
Worth exploring https://github.com/rollup/rollup-starter-lib
As easy as:
in
package.json