Skip to content

Instantly share code, notes, and snippets.

@paulshen
paulshen / transform-imports-plugin.js
Created October 13, 2021 15:55 — forked from orenelbaum/transform-imports-plugin.js
Natto Solid imports transformation plugin
export default function transformImportsPlugin({ types }) {
return {
visitor: {
ImportDeclaration(path) {
const importSource = path.node.source.value
if (importSource !== "solid-js/web") return
const solidWebIdentifier = types.Identifier("solidjsWeb")