Skip to main content
Version: 1.0.0

@farmfe/plugin-virtual

Inspired By @rollup/plugin-virtual

A rust plugin for farm to easily use virtual module

Installation​

npm install @farmfe/plugin-virtual

Usage​

farm.config.ts

import { defineConfig } from '@farmfe/core';

export default defineConfig({
plugins: [
[
'@farmfe/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';
Extremely Fast Web Build Tool Written in Rust

Copyright © 2024 Farm Community. Built with Docusaurus.