Skip to content

Instantly share code, notes, and snippets.

View orenelbaum's full-sized avatar

Oren Elbaum orenelbaum

View GitHub Profile
@orenelbaum
orenelbaum / transform-imports-plugin.js
Last active October 13, 2021 15:55
Natto Solid imports transformation plugin
function transformImportsPlugin({ types }) {
return {
visitor: {
ImportDeclaration(path) {
const importSource = path.node.source.value
if (importSource !== "solid-js/web") return
const solidWebIdentifier = types.Identifier("solidjsWeb")
@orenelbaum
orenelbaum / remove-imports-plugin.js
Last active October 14, 2021 02:12
Remove Imports Plugin
export default function removeImportsPlugin({ types }) {
return {
visitor: {
ImportDeclaration(path) {
path.remove()
}
}
}
}
@orenelbaum
orenelbaum / index.civet
Created December 8, 2022 07:24
Civet / TS comparison
{ 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