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
{{ message }}
This repository has been archived by the owner on Jan 13, 2025. It is now read-only.
In all package.json npm module definitions for all components, the current pattern seems to be to set the main property to the entry point of the source code, rather than the built distribution. I'm not particularly sure if there is a reason behind that.
This does however mean that you are putting the responsibility of building these packages onto the consumer, as webpack and other build tools will just take the main entry point. This can lead to issues if the consumer does not first build the module, such as UglifyJS failing due to the presence of ES6+ code.
In most other packages I have seen, the main property is set to the entry point from the dist folder, ensuring that the consumer does not have to worry about building the module first.
This greatly simplifies the process for the consumer, as they are ready straight away to use any of the MDC components when they import them, rather than having to build them themselves.
In summary, I propose moving all package.jsonmain properties to reference the built file in the dist directory, rather than the entry point of the source code.
Thoughts?
The text was updated successfully, but these errors were encountered:
In all
package.json
npm module definitions for all components, the current pattern seems to be to set themain
property to the entry point of the source code, rather than the built distribution. I'm not particularly sure if there is a reason behind that.This does however mean that you are putting the responsibility of building these packages onto the consumer, as webpack and other build tools will just take the
main
entry point. This can lead to issues if the consumer does not first build the module, such asUglifyJS
failing due to the presence of ES6+ code.In most other packages I have seen, the
main
property is set to the entry point from thedist
folder, ensuring that the consumer does not have to worry about building the module first.For example, in https://github.com/petkaantonov/bluebird/blob/master/package.json, the
main
property is set to./js/release/bluebird.js
, as it is the entry point of the prebuilt distributable.Another example is https://github.com/gcanti/fp-ts/blob/master/package.json, where the
main
entry point is listed as beinglib/index.js
, as it is the prebuilt distributable.This greatly simplifies the process for the consumer, as they are ready straight away to use any of the MDC components when they
import
them, rather than having to build them themselves.In summary, I propose moving all
package.json
main
properties to reference the built file in thedist
directory, rather than the entry point of the source code.Thoughts?
The text was updated successfully, but these errors were encountered: