farm-plugin-virtual
v0.0.1
Published
Inspired By [@rollup/plugin-virtual](https://www.npmjs.com/package/@rollup/plugin-virtual)
Downloads
5
Readme
farm-plugin-virtual
Inspired By @rollup/plugin-virtual
A rust plugin for farm to easily use virtual module
install
pnpm add -D farm-plugin-virtual
Usage
farm.config.ts
import { defineConfig } from '@farmfe/core';
export default defineConfig({
plugins: [
[
'farm-plugin-virtual',
{
'virtual-module': 'export const a = 1',
'src/01.js': 'export const module01 = "virtual-module"',
},
],
],
});
index.js
import { a } from 'virtual-module';
src/02.js
import { module01 } from './01.js';