This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ babel } from '@rollup/plugin-babel' | |
{ Plugin } from 'rollup' | |
{ handleRemainingPluginImports } from './handle-remaining-plugin-imports' | |
{ funcVisitor } from './func-visitor' | |
// This is the entry point for babel. | |
export babelPluginUndestructure :=-> | |
visitor := | |
FunctionDeclaration: funcVisitor |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export default function removeImportsPlugin({ types }) { | |
return { | |
visitor: { | |
ImportDeclaration(path) { | |
path.remove() | |
} | |
} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function transformImportsPlugin({ types }) { | |
return { | |
visitor: { | |
ImportDeclaration(path) { | |
const importSource = path.node.source.value | |
if (importSource !== "solid-js/web") return | |
const solidWebIdentifier = types.Identifier("solidjsWeb") |