# flow-cadence-plugin

> Webpack plugin for Cadence and Flow.

Latest version **0.0.6** (published 2024-11-07) · ISC license · 0 weekly downloads

## Install

```sh
npm install flow-cadence-plugin
pnpm add flow-cadence-plugin
yarn add flow-cadence-plugin
bun add flow-cadence-plugin
```

## Health

**Score 35/100 (D)** — status: maintenance-mode.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support; pre 1.0.

Negative: stale; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.6 |
| Published | 2024-11-07 |
| First published | 2022-11-29 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 2.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Chase Fleming |
| Maintainers | chasefleming |
| Keywords | flow, cadence |

## Links

- npm: https://www.npmjs.com/package/flow-cadence-plugin
- npm.io page: https://npm.io/package/flow-cadence-plugin

## Recent versions

- 0.0.6 (latest) — 2024-11-07
- 0.0.5 — 2023-06-14
- 0.0.4 — 2023-06-14
- 0.0.3 — 2023-06-14
- 0.0.2 — 2022-11-29
- 0.0.1 — 2022-11-29

## README

# Webpack Plugin for Cadence Files on the Flow Blockchain

This plugin allows you to import `.cdc` Cadence files directly into your project, making Flow blockchain scripts and transactions easily accessible in a Webpack-based setup. Additionally, it resolves any TypeScript type errors for `.cdc` imports, providing smooth integration with TypeScript projects.
Let me know if you’d like further adjustments!

## Usage

```javascript
import ReadHelloWorld from '../cadence/scripts/ReadHelloWorld.cdc'

await fcl.query({
  cadence: ReadHelloWorld
})
```

## Adding the Plugin

### Install

```bash
npm install flow-cadence-plugin --save-dev
```

### Webpack

To import `.cdc` files, add the plugin to your Webpack configuration:

```javascript
new FlowCadencePlugin()
```

### Next.js

To use the plugin in a Next.js project, add it to the Webpack configuration in `next.config.js`:

```javascript
import FlowCadencePlugin from 'flow-cadence-plugin'

module.exports = {
  webpack: (config) => {
    config.plugins.push(new FlowCadencePlugin())
    return config
  },
}
```

---
_Source: https://npm.io/package/flow-cadence-plugin · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
