Skip to content
This repository has been archived by the owner on May 1, 2020. It is now read-only.

Allow to provide user config as async function #1366

Open
stalniy opened this issue Jan 14, 2018 · 0 comments
Open

Allow to provide user config as async function #1366

stalniy opened this issue Jan 14, 2018 · 0 comments

Comments

@stalniy
Copy link

stalniy commented Jan 14, 2018

Short description of the problem:

It's possible to pass only sync function for custom webpack configuration (https://github.com/ionic-team/ionic-app-scripts/blob/master/src/util/config.ts#L410)

What behavior are you expecting?

It would be useful to be able to provide async function for custom webpack configuration.

Steps to reproduce:

  1. Create a custom configuration file for webpack which exports async function
  2. Specify this file in package.json config.ionic_webpack
  3. Run ionic serve

Ionic app scripts doesn't wait for async function to finish and it looks like it fallbacks to default webpack configuration.

Which @ionic/app-scripts version are you using?
3.1.0

Other information:

Webpack@^2.0.0 allows to provide configuration as async function: webpack/webpack#2697 (comment)

Use case:

I want to introspect my server's graphql schema and pass results into application via webpack.DefinePlugin. This is needed for Apollo to properly match types (more details - https://www.apollographql.com/docs/react/recipes/fragment-matching.html).

As a workaround it's possible to write this information to file but I don't want to manage temporary files.

# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant