Skip to content

esm webpack build is not getting generated #295

Description

@veeramarni
  1. Our develop branch which currently working uses esm. The reason we need to use this esm wrapper (you can check in develop branch when you run webpack build there is index.js file wrapping with esm) is for nodejs to support esm package converting to commonjs using esm's require. Webpack for server side won't bundle node_module packages as we exclude here

  2. For nodejs 16 supports ESM but with few restrictions.

  3. Our purpose is to generate esm build using webpack (which means there shouldn't be require commonjs functions used in the generated build). In our test we used this branch, we commented the browser bundle for the time being.

  4. The frontend webpack build can be triggered using the following command. Prior to it, you need to finish yarn && yarn build

lerna exec --scope="*frontend-server" yarn build && lerna exec --scope="*frontend-server" yarn start:dev
  1. Since the webpack config, is not generating ESM bundle, if we start node by putting type: module in frontend-server's package.json it errors as it complains the generated bundle has require

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions