unplugin-raw
TypeScript icon, indicating that this package has built-in type declarations

0.1.1 • Public • Published

unplugin-raw npm

Unit Test

Transform file to a default-export string. It will be transformed to JavaScript, then a string.

Installation

npm i -D unplugin-raw
Vite
// vite.config.ts
import Raw from 'unplugin-raw/vite'

export default defineConfig({
  plugins: [Raw()],
})


Rollup
// rollup.config.js
import Raw from 'unplugin-raw/rollup'

export default {
  plugins: [Raw()],
}


esbuild
// esbuild.config.js
import { build } from 'esbuild'

build({
  plugins: [require('unplugin-raw/esbuild')()],
})


Usage

import text from './ts.ts?raw'
import text2 from './js.js?raw'
import text3 from './jsx.jsx?raw'

Sponsors

License

MIT License © 2023-PRESENT 三咲智子

Package Sidebar

Install

npm i unplugin-raw

Weekly Downloads

46

Version

0.1.1

License

MIT

Unpacked Size

16.5 kB

Total Files

27

Last publish

Collaborators

  • userquin
  • hannoeru
  • sxzz
  • antfu