Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/unlight/fusebox-gulp-plugin
Adapt gulp plugins to work with fuse-box
https://github.com/unlight/fusebox-gulp-plugin
fusebox
Last synced: 6 days ago
JSON representation
Adapt gulp plugins to work with fuse-box
- Host: GitHub
- URL: https://github.com/unlight/fusebox-gulp-plugin
- Owner: unlight
- Created: 2016-12-27T19:25:21.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2017-04-26T17:57:57.000Z (over 7 years ago)
- Last Synced: 2024-11-04T06:34:59.659Z (9 days ago)
- Topics: fusebox
- Language: TypeScript
- Size: 27.3 KB
- Stars: 3
- Watchers: 3
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
fusebox-gulp-plugin
===================
Adapt gulp plugins to work with fuse-box.## Usage
```js
const fsbx = require('fuse-box');
const g = require('gulp-load-plugins')();
const { GulpPlugin } = require('fusebox-gulp-plugin');const fuseBox = fsbx.FuseBox.init({
homeDir: 'src/',
outFile: './build/app.js',
plugins: [
// Other fusebox plugins...
GulpPlugin([
(file) => g.replace('foo', 'bar'),
// Other gulp plugins...
])
]
});
```**Note:**
GulpPlugin is applicable to all files, so you must control type of transform by `ChainPlugin`
(see examples below).Also, you can use only those plugins which only manipulates `contents` property of vinyl file.
Applying of some plugins, like `gulp-rename`, does not make sense,
because they do not affect `contents`, but others - path, dirname, etc.### API
```js
function GulpPlugin(streamFactories: ((file: File) => stream.Transform)[])
```### Examples
```js
const { GulpPlugin } = require('fusebox-gulp-plugin');
const g = require('gulp-load-plugins')();
```#### Markdown
```js
const plugins = [
[
/\.md$/,
GulpPlugin([
() => g.markdown(),
]),
RawPlugin({ extensions: ['.md'] }),
]
];
```
```js
var doc = require('./doc.md')
```#### JSON5
```js
const plugins = [
{
init: (k) => k.allowExtension('.json5')
},
[
/\.json5$/,
GulpPlugin([
() => g.json5(),
]),
JSONPlugin({}),
]
];
```
```js
const data = require('./data.json5');
```### DEBUG
```
inspect node_modules/ava/profile.js lib/index.spec.js
```