0.1.4 • Published 2 months ago

@subbly/swc-plugin-add-element-source v0.1.4

Weekly downloads
-
License
MIT
Repository
-
Last release
2 months ago

@subbly/swc-plugin-add-element-source

Automatically add JSX element source information.

<!-- Before -->
<div></div>

<!-- After -->
<div 
  data-sbly-id="/src/components/Component.tsx:16:5" 
  data-sbly-component-path="/src/components/Component.tsx"
  data-sbly-component-line="16"
></div>

Installation

Install as devDependency with your preferred package manager.

npm i -D @subbly/swc-plugin-add-element-source

Add plugin to SWC config. Here is an example how to use the plugin with Next.js

// next.config.ts
const nextConfig: NextConfig = {
    experimental: {
        swcPlugins: [
            // Pass an empty object to satisfy SWC's API schema.
            ['@subbly/swc-plugin-add-element-source', {}]
        ]
    }
};

Configuration

No configuration options.

License

MIT

0.1.4

2 months ago

0.1.3

2 months ago

0.1.2

2 months ago

0.1.1

2 months ago

0.1.0

2 months ago