# vite_deno_dnt

> Vite Deno Plugin - transpiled to Node

Latest version **0.1.0** (published 2023-12-16) · MIT license · 0 weekly downloads

## Install

```sh
npm install vite_deno_dnt
pnpm add vite_deno_dnt
yarn add vite_deno_dnt
bun add vite_deno_dnt
```

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.0 |
| Published | 2023-12-16 |
| First published | 2023-12-16 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 2 |
| Unpacked size | 455.5 KB |
| Known vulnerabilities | 0 (+18 in 1 direct dependencies) |
| Install scripts | no |
| Maintainers | jamescarmody |

## Links

- npm: https://www.npmjs.com/package/vite_deno_dnt
- npm.io page: https://npm.io/package/vite_deno_dnt

## Dependencies (2)

- [vite](https://npm.io/package/vite.md) 4.5.0
- [@deno/shim-deno](https://npm.io/package/@deno/shim-deno.md) ~0.17.0

## Recent versions

- 0.1.0 (latest) — 2023-12-16

## README

# vite-deno-plugin

[![deno module](https://shield.deno.dev/x/vite_deno_plugin)](https://deno.land/x/vite_deno_plugin)

A [Vite](https://vitejs.dev) plugin that can resolve Deno modules.

 - Run Vite without `node_modules` directory.
 - URL import just works.
 - Import map support.

## Motivation

Deno now supports npm module loading and can run Vite. However, the development experience with Deno is not consistent with Vite, as Vite tries to load modules from `node_modules`, which requires a `node_modules` directory and `--node-modules-dir` flag. By using this plugin, the same module resolution as in Deno can be used inside Vite.

## Getting Started

Configure a plugin in `vite.config.mts`(NOT `vite.config.ts`).

```typescript
import { defineConfig } from 'npm:vite@4.5.0';
import viteDeno from 'https://deno.land/x/vite_deno_plugin/mod.ts';

export default defineConfig({
  plugins: [viteDeno({})],
});
```

```bash
$ deno run -A npm:vite@4.5.0 . --config ./vite.config.mts
```

For more details, check out [React example](https://github.com/anatoo/vite-deno-plugin/tree/main/examples/react) directory.

## Config

### `importMapFilename`

Specify the filename of import map. Default value is `deno.json`.

```typescript
viteDeno({
  importMapFilename: "deno.json"
});
```

## Known Issues

 - Currently `npm:*` specifier is not supported. So you have to load npm modules via `https://esm.sh/` instead.

## Examples

 - [React](https://github.com/anatoo/vite-deno-plugin/tree/main/examples/react)

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