fusebox-chain-plugin
v1.0.7
Published
Custom chain plugin for FuseBox
Downloads
12
Readme
fusebox-chain-plugin
Custom chain plugin for FuseBox.
FEATURES
- Cache chained plugins
- Conditional compilation
INSTALL
npm i -D fusebox-chain-plugin
USAGE
import { ChainPlugin } from 'fusebox-chain-plugin';
// part of fusebox config
plugins: [
ChainPlugin(options, [
SassPlugin(),
CSSPlugin()
])
]
Conditional compilation
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(),
]
}),
API
ChainPlugin(plugins: Plugin[] | { [k: string]: Plugin[] });
ChainPlugin(options: Options, plugins: Plugin[] | { [k: string]: Plugin[] });
Options
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).
Plugin[]
Array of fusebox plugins.
{ [k: string]: Plugin[] }
Split transform pipiline by extension.
DEBUG
- Debug benchmark
inspect node_modules\ts-node\dist\_bin.js benchmarks\benchmark.ts