webpack-local-module
v1.1.0
Published
> write virtual module into disk
Downloads
5
Readme
webpack-local-module
write virtual module into disk
install
pnpm i webpack-local-module -D
usage
register plugin in config
const rspack = require('@rspack/core')
const { WebpackLocalModule } = require('webpack-local-module')
/**
* @type {import('@rspack/cli').Configuration}
*/
module.exports = {
// ...other config
plugins: [
new WebpackLocalModule({
'virtual-module': 'export const id = "virtual-module"',
}),
],
}
import virtual-module
in project, e.g.
import vm from 'virtual-module'
options
options.dirname
- type
string
- default
.rlm
plugin write module content into <root>/node_modules/.rlm
dir by default
built with ❤️ by 😼