@tongzag/rollup-plugin-bytenode
v0.0.1
Published
rollup your code use bytenode
Readme
@tongzag/rollup-plugin-bytenode
A Simple Rollup plugin compile your code use bytenode
Install
# npm
npm install --save-dev @tongzag/rollup-plugin-bytenode
# yarn
yarn add -D @tongzag/rollup-plugin-bytenode
# pnpm
pnpm add -D @tongzag/rollup-plugin-bytenodeUsage
Create a rollup.config.js configuration file and import the plugin:
import bytenode from '@tongzag/rollup-plugin-bytenode';
export default {
input: 'src/index.js',
output: {
dir: 'output',
format: 'cjs'
},
plugins: [bytenode()]
};ensure that this plugin is added to the
pluginsarray after all
Options
compileAsModule
Type: boolean
Default: false
If true, the output will be a commonjs module.
electron
Type: boolean
Default: false
If true, the output will be a compiled through Electrong. Default: false.
includes
Type: Regexp
Default: /[^\.]+(\.jsc)\..+/
Plugin will match all files then transform to bytenode file
Caution
- Because of bytenode issue, i use
@babel/plugin-transform-arrow-functionsto compilearrow function - Compile
bytenode filetocommonjseven if you determineoutput.format = 'esm'
