You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Today we build each util as a separate module in order to guarantee that it's possible to import only the utils that we need without relying on opaque tree-shaking processes in build tools.
In order to get nice imports like import x from @Teachiq/utils/x as well as avoid clutter in the root directory of the project, we're forced to do the following since npm (package.json) doesn't have a great interface for structure the package contents:
build each separate module into the libdirectory
move the modules to the root directory of the project
run npm publish, where package.json is set to point at each module at the root (see the files option)
move the modules back to lib to avoid clutter in the root directory
This requires a whole lot of setting up if a new type of utility module is to be added, which may be a large time sink.
My suggestions to solve this:
Let the root directory be cluttered and just build package directly there
Make a build script that magically handles building and publishing modules in the source directory
Simplify the project structure and rely on build-tool treeshaking
The text was updated successfully, but these errors were encountered:
Today we build each util as a separate module in order to guarantee that it's possible to import only the utils that we need without relying on opaque tree-shaking processes in build tools.
In order to get nice imports like
import x from @Teachiq/utils/x
as well as avoid clutter in the root directory of the project, we're forced to do the following since npm (package.json) doesn't have a great interface for structure the package contents:lib
directorynpm publish
, where package.json is set to point at each module at the root (see thefiles
option)lib
to avoid clutter in the root directoryThis requires a whole lot of setting up if a new type of utility module is to be added, which may be a large time sink.
My suggestions to solve this:
The text was updated successfully, but these errors were encountered: