Built-in support for unspecified es modules

252
0
10-11-2023 02:46 PM
Status: Open
MichaelKowal
New Contributor II

Custom Widgets are not currently able to use es modules that are not fully specified without adding custom webpack configuration in the webpack overrides file.  This works for local development but makes distribution of custom widgets difficult. Every instance of developer edition that uses the custom widget requires that the widget-webpack-overrides.js file be changed. 

If the webpack overrides could be done by each widget individually, or if the default webpack config included the snippet below then npm modules marked with `type: module` in their package.json would be easily usable in custom widgets

 

module: {
  rules: [
    ...,
    {
      test: /\.m?js/,
      resolve: {
        fullySpecified: false
      }
    }
  ]
}