0.0.1 • Published 2 months ago
@xiaohuohumax/rollup-plugin-raw v0.0.1
@xiaohuohumax/rollup-plugin-raw
Rollup 插件: 将文件以字符串导入
import info from './info.txt?raw';
console.log(info);
Install
npm i @xiaohuohumax/rollup-plugin-raw
Use
import { defineConfig } from 'rollup'
import raw from '@xiaohuohumax/rollup-plugin-raw';
export default defineConfig({
input: 'src/index.ts',
output: [{
dir: 'dist',
format: "cjs",
entryFileNames: '[name].cjs'
}],
plugins: [raw()]
})
Typescript
tsconfig.json
{
"compilerOptions": {
"types": [
"@xiaohuohumax/rollup-plugin-raw/client"
],
}
}
0.0.1
2 months ago