Custom Webpack config not supported with ES Modules
- Dominant language
- JavaScript
- Stars
- 6
- Forks
- 25
- Avg merge
- 3d 10h
- Merged PRs (30d)
- 2
Description
### Expected Behaviour
* Custom Webpack configuration can be provided for a project using ES Modules.
### Actual Behaviour
```
➜ sequence_test git:(main) ✗ aio app run --local
ℹ checking if java is installed...
ℹ checking if docker is installed...
ℹ checking if docker is running...
ℹ starting local OpenWhisk stack...
ℹ writing credentials to tmp wskdebug config '/Users/mgoberling/repos/adobe/my-utils/utils/sequence_test/dist/application/.env.local'
ℹ building actions..
› Error: require() of ES Module /Users/mgoberling/repos/adobe/my-utils/utils/sequence_test/actions/first/webpack-config.js from
› /usr/local/lib/node_modules/@adobe/aio-cli/node_modules/@adobe/aio-lib-runtime/src/build-actions.js not supported.
› Instead change the require of webpack-config.js in /usr/local/lib/node_modules/@adobe/aio-cli/node_modules/@adobe/aio-lib-runtime/src/build-actions.js to a dynamic
› import() which is available in all CommonJS modules.
```
#### Steps to Reproduce
* `aio app init` with action
* Add `webpack-configuration.js` to your action folder
* Add `"type": "module"` to project `package.json`
* Run `aio app run --local`
* See error above
#### Additional notes
Due to import when building actions [here](https://github.com/adobe/aio-lib-runtime/blob/943e3dfd542c7f6c5d08617987097d08b6daf13d/src/build-actions.js#L62)
Contributor guide
Assessment
This issue has not been assessed yet.