{"id":26783,"library":"babel-plugin-wallace","title":"Babel Plugin for Wallace","description":"This package provides the necessary Babel plugin for the Wallace framework (version 0.17.1, actively developed). It transforms JSX and other syntax to enable features like server-side rendering and component hydration within Wallace applications. Unlike generic Babel presets, this plugin is tailored specifically for Wallace's runtime, handling Wallace-specific directives and optimizations. It ships with TypeScript definitions and is typically used alongside the core `wallace` package. The plugin follows the release cadence of the main Wallace framework, with frequent updates to match new features.","status":"active","version":"0.17.1","language":"javascript","source_language":"en","source_url":null,"tags":["javascript","typescript"],"install":[{"cmd":"npm install babel-plugin-wallace","lang":"bash","label":"npm"},{"cmd":"yarn add babel-plugin-wallace","lang":"bash","label":"yarn"},{"cmd":"pnpm add babel-plugin-wallace","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Peer dependency required for Babel plugin functionality","package":"@babel/core","optional":false}],"imports":[{"note":"ESM import is preferred. The default export is a Babel plugin function.","wrong":"const wallace = require('babel-plugin-wallace')","symbol":"default","correct":"import wallace from 'babel-plugin-wallace'"},{"note":"PluginConfig is a TypeScript type, not a runtime value. Use type import.","wrong":"const { PluginConfig } = require('babel-plugin-wallace')","symbol":"PluginConfig","correct":"import type { PluginConfig } from 'babel-plugin-wallace'"},{"note":"Export is named, not default.","wrong":"import createWallacePlugin from 'babel-plugin-wallace'","symbol":"createWallacePlugin","correct":"import { createWallacePlugin } from 'babel-plugin-wallace'"},{"note":"Named export. Double-check exact name; this may have been renamed.","wrong":"import babelPluginWallace from 'babel-plugin-wallace'","symbol":"babelPluginWallace","correct":"import { babelPluginWallace } from 'babel-plugin-wallace'"}],"quickstart":{"code":"// babel.config.js\nimport wallacePlugin from 'babel-plugin-wallace';\n\nexport default {\n  plugins: [\n    [wallacePlugin, {\n      // Options such as 'sourceMap' or 'target'\n      sourceMap: true,\n      target: 'server' // or 'client'\n    }]\n  ]\n};\n\n// In a script:\nimport { transformSync } from '@babel/core';\nconst code = `<div>Hello</div>`;\nconst result = transformSync(code, {\n  plugins: [['babel-plugin-wallace', { target: 'client' }]]\n});\nconsole.log(result.code);","lang":"javascript","description":"Shows how to configure the Wallace Babel plugin in babel.config.js and use it programmatically with @babel/core to transform JSX."},"warnings":[{"fix":"Update import from 'import wallace from ...' to 'import { wallacePlugin } from ...' or adjust require accordingly.","message":"Version 0.15.0 changed the plugin export from default to named export.","severity":"breaking","affected_versions":">=0.15.0"},{"fix":"Remove `sourceMap` option and rely on Babel's `sourceMaps: true` in config.","message":"The `sourceMap` option is deprecated in favor of Babel's built-in source map support.","severity":"deprecated","affected_versions":">=0.16.0"},{"fix":"Ensure @babel/core version is >=7.0.0.","message":"Requires Babel 7 or higher. Using with Babel 6 will fail silently or throw errors.","severity":"gotcha","affected_versions":">=0.10.0"},{"fix":"Add '@babel/preset-typescript' before this plugin in the plugins array.","message":"The plugin does not support TypeScript JSX (TSX) natively; you need to combine with @babel/preset-typescript.","severity":"gotcha","affected_versions":">=0.10.0"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"Run `npm install babel-plugin-wallace --save-dev`.","cause":"The package is not installed or not in node_modules.","error":"Error: Cannot find module 'babel-plugin-wallace'"},{"fix":"Change to `import { wallacePlugin } from 'babel-plugin-wallace'` or use `require('babel-plugin-wallace').default`.","cause":"Wrong import style: using default import when package exports a named function.","error":"TypeError: wallace is not a function"},{"fix":"Upgrade to Babel 7: `npm install @babel/core --save-dev` and update config to use @babel/ prefix.","cause":"Incompatible Babel version.","error":"Error: Babel 7.0.0 is required but you have 6.26.3"},{"fix":"Add '@babel/preset-react' to presets and ensure this plugin runs after.","cause":"Missing Babel preset for JSX (used by default in create-react-app).","error":"SyntaxError: Unexpected token (1:1) with JSX"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}