1.0.7 • Published 7 years ago

fusebox-chain-plugin v1.0.7

Weekly downloads
1
License
MIT
Repository
github
Last release
7 years ago

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 to context.allowExtension(ext) on init.
  • extensions?: string[] Same as extension
  • 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
1.0.7

7 years ago

1.0.6

7 years ago

1.0.5

7 years ago

1.0.4

7 years ago

1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago