Skip to content

Commit

Permalink
Merge pull request #3 from divriots/targets
Browse files Browse the repository at this point in the history
feat: being able to specify targets
  • Loading branch information
muryoh authored Jan 24, 2022
2 parents d86d357 + 45f50b3 commit c8b80c0
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,10 @@ export interface FirebasePluginOptions {
projectId: string | ((server: ViteDevServer) => string)
root?: string
materializeConfig?: boolean
targets: string[]
}

export default function firebasePlugin({projectId, root, materializeConfig}: FirebasePluginOptions) {
export default function firebasePlugin({projectId, root, materializeConfig, targets = ['hosting', 'functions']}: FirebasePluginOptions) {
return {
name: "vite:firebase",
async configureServer(server: ViteDevServer) {
Expand All @@ -45,8 +46,8 @@ export default function firebasePlugin({projectId, root, materializeConfig}: Fir
projectDir,
nonInteractive: true,
account,
only: 'hosting,functions',
targets: ['hosting', 'functions']
only: targets.join(','),
targets
};
const config = Config.load(options);
// @ts-ignore
Expand Down

0 comments on commit c8b80c0

Please sign in to comment.