Skip to content

Can you pass JS functions into the package as configuration? #3535

Closed
@steveworkman

Description

@steveworkman

What problem does this feature solve?

I'm creating a standardised babel config in a preset. This config requires that different configuration is used depending on the process.env options, in particular when Jest is running in test mode.

  api.extendPackage({
    babel: {
      ignore:  process.env === "test" ? ["core-js/*"] : []
    }
  });

This results in

module.exports = {
  presets: [
    '@vue/app'
  ],
  ignore: []
}

What does the proposed API look like?

I'm not sure. The generator script is evaluating the code when it is running, so I guess it would need to be a method similar to that but that takes a string to be evaluated.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions