message: Fix tree-shaking (closes
  Fixed broken tree-shaking caused by missing links to corresponding ESM.
diff: @@ -18,18 +18,23 @@ const rootPath =
  const extraModules = [
  { fullPath: './src/fp/index.js' },
  - { fullPath: './src/locale/index.js' }
  + { fullPath: './src/locale/index.js' },
  ]
  -const initialPackages = getInitialPackages()
  +writePackages()
  -listAll()
  - .then(modules =>
  - Promise.all(modules.map(module => writePackage(module.fullPath)))
  +async function writePackages() {
  + const initialPackages = await getInitialPackages()
  + const modules = await listAll()
  + await Promise.all(
  + modules.map(async (module) =>
  + writePackage(module.fullPath, initialPackages[module.fullPath])
  )
  - .then('package.json files are generated')
  + )
  + console.log('package.json files are generated')
  +}
  -function writePackage(fullPath) {
  +function writePackage(fullPath, initialPackage) {
  const dirPath = path.dirname(fullPath)
  const typingsRelativePath = path.relative(dirPath, `./src/typings.d.ts`)
  const packagePath = path.resolve(
  @@ -40,8 +45,8 @@ function writePackage(fullPath) {
  return writeFile(
  packagePath,
  JSON.stringify(
  - Object.assign({ sideEffects: false }, initialPackages[fullPath] || {}, {
  - typings: typingsRelativePath
  + Object.assign({ sideEffects: false }, initialPackage || {}, {
  + typings: typingsRelativePath,
  }),
  null,
  2
  @@ -79,7 +84,7 @@ async function listAll() {
  .concat(extraModules)
  .reduce((acc, module) => {
  const esmModule = Object.assign({}, module, {
  - fullPath: module.fullPath.replace('./src/', './src/esm/')
  + fullPath: module.fullPath.replace('./src/', './src/esm/'),
  })
  return acc.concat([module, esmModule])
  }, [])
  