Custom chain plugin for FuseBox.
- Cache chained plugins
- Conditional compilation
npm i -D fusebox-chain-plugin
import { ChainPlugin } from 'fusebox-chain-plugin';
// part of fusebox config
plugins: [
ChainPlugin(options, [
SassPlugin(),
CSSPlugin()
])
]
All .component.scss
files will be inlined, others .scss
handles like usual css.
ChainPlugin({ extension: '.scss', test: /\.scss$/ }, {
'.component.scss': [
SassPlugin({ sourceMap: false }),
RawPlugin({}),
],
'.scss': [
SassPlugin({}),
CSSPlugin(),
]
}),
ChainPlugin(plugins: Plugin[] | { [k: string]: Plugin[] });
ChainPlugin(options: Options, plugins: Plugin[] | { [k: string]: Plugin[] });
extension?: string
Will be passed tocontext.allowExtension(ext)
on init.extensions?: string[]
Same asextension
test?: RegExp
Filter files by this regexp, if not set, first in plugins array will be used.hmr?: boolean
Enable HMR. Default:true
hmrType?: string
Since plugin can be applied to any type of file, you muse explicitly set type of HMR file which will be emitted (this is non-usual case and you need custom frontend fusebox plugin to handle HMR properly).
Array of fusebox plugins.
Split transform pipiline by extension.
- Debug benchmark
inspect node_modules\ts-node\dist\_bin.js benchmarks\benchmark.ts