Skip to content

How could I copy different files in development mode and production mode? #116

Answered by sapphi-red
s3xysteak asked this question in Q&A
Discussion options

You must be logged in to vote

Hmm, maybe something like this?

function mergeApply(apply1, apply2) { /*  */ }

function aPlugin() {
  return [
    [...viteStaticCopy({ target: targetForProd })].map(plugin => ({ ...plugin, apply: mergeApply(plugin.apply, mode => mode === 'production') })),
    [...viteStaticCopy({ target: targetForDev })].map(plugin => ({ ...plugin, apply: mergeApply(plugin.apply, mode => mode !== 'production') })),
  ]
}

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@s3xysteak
Comment options

@sapphi-red
Comment options

Answer selected by s3xysteak
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #115 on May 14, 2024 12:29.