Parcel JSY Transformer
raw JSON → 0.2.1 verified Fri May 01 auth: no javascript
A Parcel 2.x transformer plugin for JSY syntax, a JavaScript superset with syntactic sugar. Current stable version is 0.2.1. It transpiles JSY files to standard JavaScript without relying on Babel, instead using the JSY compiler directly. Designed for Parcel 2.x (alpha.3.2+), it integrates as a Parcel transformer plugin, enabling JSX-like syntax and other JSY features in a Parcel build pipeline. Differentiates from Babel-based solutions by being lightweight and Parcel-native.
Common errors
error Error: Cannot find module '@parcel/plugin' ↓
cause Missing PeerDependency @parcel/plugin when installing plugin standalone.
fix
Add @parcel/plugin as a devDependency: npm install --save-dev @parcel/plugin
error Parcel build fails: "Unknown file type .jsy" ↓
cause JSY file extension not mapped to transformer in .parcelrc.
fix
Add {"transformers": {"*.jsy": ["parcel-transformer-jsy"]}} to .parcelrc.
error SyntaxError: Unexpected token '.' (or other JSY syntax) ↓
cause JSY syntax not transformed because plugin not applied or outdated version.
fix
Ensure .parcelrc correctly references plugin and run 'npm update parcel-transformer-jsy'.
Warnings
gotcha Plugin requires Parcel 2.0.0 or newer; does not work with Parcel 1.x. ↓
fix Use Parcel 2 and ensure package.json lists parcel ^2.0.0.
deprecated The package name on npm is 'parcel-transformer-jsy' but the GitHub repo uses 'parcel-plugin-jsy' (legacy). ↓
fix Use npm package parcel-transformer-jsy for installation.
gotcha JSY syntax not supported by standard linters/editors; may cause false positives. ↓
fix Use JSY-specific ESLint plugin or disable linting for .jsy files.
breaking In version 0.2.0, the transformer configuration key changed from 'jsy' to 'parcel-transformer-jsy' in .parcelrc. ↓
fix Update .parcelrc to use 'parcel-transformer-jsy' as the transformer plugin name.
Install
npm install parcel-transformer-jsy yarn add parcel-transformer-jsy pnpm add parcel-transformer-jsy Imports
- default export wrong
const parcelTransformerJSY = require('parcel-transformer-jsy')correctimport parcelTransformerJSY from 'parcel-transformer-jsy' - ParcelTransformerJSY wrong
const { ParcelTransformerJSY } = require('parcel-transformer-jsy')correctimport ParcelTransformerJSY from 'parcel-transformer-jsy' - jsyOptions wrong
import { jsyOptions } from 'parcel-transformer-jsy'correctimport jsyOptions from 'parcel-transformer-jsy/dist/config'
Quickstart
// .parcelrc
{
"extends": "@parcel/config-default",
"transformers": {
"*.jsy": ["parcel-transformer-jsy"]
}
}
// package.json
{
"scripts": {
"build": "parcel build src/index.jsy"
},
"devDependencies": {
"parcel": "^2.0.0",
"parcel-transformer-jsy": "^0.2.0"
}
}