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

Support Array BuildConfig #245

Closed
1 task
sadeghbarati opened this issue Apr 3, 2023 · 1 comment · Fixed by #275
Closed
1 task

Support Array BuildConfig #245

sadeghbarati opened this issue Apr 3, 2023 · 1 comment · Fixed by #275

Comments

@sadeghbarati
Copy link

sadeghbarati commented Apr 3, 2023

Describe the feature

Refrence:

Currently unbuild ^1.2.0 defineBuildConfig support one BuildConfig not BuildConfig[]
unbuild expose an API called build to do things in a programmatic way,
But I prefer using build.config.ts file with unbuild cli instead of creating a script file like build.mjs

Additional information

I want to apply different configs per entry

Simple example

import { defineBuildConfig } from 'unbuild'

export default defineBuildConfig([
  {
    entries: 'src/index',
    replace: {
      __DEV__: `(process.env.NODE_ENV === 'development')`
    }
    rollup: {
      emitCJS: true
    }
  },
  {
    entries: 'src/index',
    outDir: 'dist/min',
    replace: {
      __DEV__: JSON.stringify(process.env.NODE_ENV === 'development')
    }
    rollup: {
      emitCJS: true,
      esbuild: {
        minify: true
      }
    }
  }
])

Advanced example

Pinia rollup.config

I like unbuild jiti1 and hooks features, and I wonder how to convert that config to unbuild.config

  • Would you be willing to help implement this feature?

Footnotes

  1. jitti feature is not compatible with monorepos

@patzick
Copy link
Contributor

patzick commented Jun 29, 2023

I need the same thing so prepared PR related to this issue :)

@pi0 pi0 closed this as completed in #275 Jul 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants