MCPcopy
hub / github.com/vitejs/vite / replaceLegacyEnvBabelPlugin

Function replaceLegacyEnvBabelPlugin

packages/plugin-legacy/src/index.ts:1048–1059  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1046}
1047
1048function replaceLegacyEnvBabelPlugin(): BabelPlugin {
1049 return ({ types: t }): BabelPlugin => ({
1050 name: 'vite-replace-env-legacy',
1051 visitor: {
1052 Identifier(path) {
1053 if (path.node.name === legacyEnvVarMarker) {
1054 path.replaceWith(t.booleanLiteral(true))
1055 }
1056 },
1057 },
1058 })
1059}
1060
1061function replaceModernEnvBabelPlugin(): BabelPlugin {
1062 return ({ types: t }): BabelPlugin => ({

Callers 1

renderChunkFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected