Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow custom webpack configuration for bundling actions #344

Closed
rajarju opened this issue Dec 4, 2020 · 7 comments
Closed

Allow custom webpack configuration for bundling actions #344

rajarju opened this issue Dec 4, 2020 · 7 comments
Assignees
Labels
enhancement New feature or request

Comments

@rajarju
Copy link
Contributor

rajarju commented Dec 4, 2020

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
When deploying actions aio app plugin bundles the actions with a pre-defined webpack config.
I would like to include some additional files, like handlebar templates or jsx components as part of the package.
This is not possible as the bundler doesn't like anything other than js files and I am not able to configure it with a webpack config file.

Describe the solution you'd like

The app plugin when bundling can look for a webpack config file under the action directory

  1. Gives priority to the webpack config based on proximity to the action file
  2. Config file under an action directory will be used when bundling the current action
  3. Config files under the actions directory will be used to bundle all actions
  4. Config file if present at the root of the project will be used for all actions

The values in the custom webpack config will be used to override the standard aio app bundle config

Describe alternatives you've considered
A workaround is to run a custom bundler to compile/convert your files to js and add them to the actions directory

Additional context
Add any other context or screenshots about the feature request here.

@meryllblanchet meryllblanchet added the enhancement New feature or request label Dec 7, 2020
@meryllblanchet
Copy link
Contributor

Thanks @rajarju ! Let's discuss about it this week.

@aiojbot
Copy link
Collaborator

aiojbot commented Dec 7, 2020

JIRA issue created: https://jira.corp.adobe.com/browse/ACNA-981

@icaraps
Copy link

icaraps commented Dec 9, 2020

@meryllblanchet I wonder if exposing the webpack config is still necessary now that we have new hooks to build actions AdobeDocs/app-builder#83

@meryllblanchet
Copy link
Contributor

@icaraps there could be use-cases for which the whole config has to be changed, specifically for a single action or a sub-group of actions within an app.

I feel like using build-actions could mean forking our own action build script in that case, while exposing the webpack config would make it easier.

WDYT?

@icaraps
Copy link

icaraps commented Dec 9, 2020

@meryllblanchet I'd pick 2-3 use cases and compare both solutions (hook vs custom webpack config) to identify pros and cons wdyt ?

@meryllblanchet
Copy link
Contributor

@icaraps this is an excellent idea. By the way @rajarju, do you have use-cases to provide?
When you say

I would like to include some additional files, like handlebar templates or jsx components as part of the package.

I expect this to be related to a use-case you've been working on.

@rajarju
Copy link
Contributor Author

rajarju commented Dec 9, 2020

The handlebar use case came up during the hackathon. Devs wanted to bundle hbs files in their action package.
The workaround was to use app hooks and run a custom bundler to convert the hbs files to js and save it in the action directory.

Including assets like images is another case.

IMO it would still be useful to have ways to configure each action. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

5 participants