Skip to content

Commit

Permalink
[ci] format
Browse files Browse the repository at this point in the history
  • Loading branch information
natemoo-re authored and actions-user committed Mar 24, 2022
1 parent 1026345 commit e2885df
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions packages/astro/src/vite-plugin-env/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ export default function envVitePlugin({ config: astroConfig }: EnvPluginOptions)
// BUT we only want to inject private keys referenced in the file.
// We overwrite this value on a per-file basis.
'import.meta.env': `({})`,
})
});
pattern = new RegExp(
// Do not allow preceding '.', but do allow preceding '...' for spread operations
'(?<!(?<!\\.\\.)\\.)\\b(' +
Expand Down Expand Up @@ -107,11 +107,11 @@ export default function envVitePlugin({ config: astroConfig }: EnvPluginOptions)
let replacement = '' + replacements[match[1]];
// If we match exactly `import.meta.env`, define _only_ referenced private variables
if (match[0] === 'import.meta.env') {
replacement = `(Object.assign(import.meta.env,{`
replacement = `(Object.assign(import.meta.env,{`;
for (const key of references.values()) {
replacement += `${key}:${privateEnv[key]},`
replacement += `${key}:${privateEnv[key]},`;
}
replacement += '}))'
replacement += '}))';
}
s.overwrite(start, end, replacement);
}
Expand Down

0 comments on commit e2885df

Please sign in to comment.