Skip to content

Custom Webpack config not supported with ES Modules #110

Description

@MichaelGoberling

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions