dir entry in package.json required


(张磊) #1

Most of the time we develop an library (for example libx) in libx/src directory, and publish it with libx/lib or libx/dist after building it.
We may use it in another project with require('libx/dist/utils.js') which looks ugly.
I wonder below:

  1. we could provide a new package.json config maybe called mainDir, and then require('libx/utils.js') will be automatic tranlated to require('libx/${mainDir}/utils.js.
  2. we also could provide some items below publish config to control mainDir to be automatic switched between develop and publish.

This would be wonderful!