Created
July 8, 2019 00:11
-
-
Save ezekielchentnik/f0072e7d9871eedde2d4781c716c712d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "rollup-kitchensink", | |
"version": "0.0.0", | |
"description": "Kitchensink of rollup plugins", | |
"author": "Ezekiel Chentnik", | |
"license": "MIT", | |
"scripts": { | |
"test": "echo write tests yo" | |
}, | |
"dependencies": { | |
"rollup-load-plugins": "0.3.0", | |
"rollup-plugin-alias": "1.3.1", | |
"rollup-plugin-babel": "2.7.1", | |
"rollup-plugin-buble": "0.15.0", | |
"rollup-plugin-commonjs": "8.0.2", | |
"rollup-plugin-css": "1.0.10", | |
"rollup-plugin-filesize": "1.2.1", | |
"rollup-plugin-gzip": "1.1.0", | |
"rollup-plugin-hash": "1.2.0", | |
"rollup-plugin-image": "1.0.2", | |
"rollup-plugin-inject": "2.0.0", | |
"rollup-plugin-json": "2.1.1", | |
"rollup-plugin-md": "0.0.7", | |
"rollup-plugin-memory": "2.0.0", | |
"rollup-plugin-node-builtins": "2.1.0", | |
"rollup-plugin-node-globals": "1.1.0", | |
"rollup-plugin-node-resolve": "3.0.0", | |
"rollup-plugin-postcss": "0.4.1", | |
"rollup-plugin-replace": "1.1.1", | |
"rollup-plugin-scss": "0.2.0", | |
"rollup-plugin-string": "2.0.2", | |
"rollup-plugin-uglify": "1.0.2", | |
"rollup-plugin-url": "1.1.0", | |
"rollup-plugin-yaml": "1.0.0" | |
}, | |
"repository": { | |
"type": "git", | |
"url": "https://github.com/gufsky/rollup-kitchensink.git" | |
}, | |
"bugs": { | |
"url": "https://github.com/gufsky/rollup-kitchensink/issues" | |
}, | |
"homepage": "https://github.com/gufsky/rollup-kitchensink" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const _loadPlugins = require('rollup-load-plugins') | |
let foundPlugins | |
const loadPlugins = () => { | |
if (!foundPlugins) { | |
foundPlugins = _loadPlugins() | |
} | |
} | |
const configure = (options) => { | |
loadPlugins() | |
return Object.keys(options).reduce((acc, plugin) => { | |
if (foundPlugins[plugin] && typeof foundPlugins[plugin] === 'function') { | |
return foundPlugins[plugin](options[plugin]) | |
} | |
}, []) | |
} | |
foundPlugins.plugins = configure | |
module.exports = foundPlugins |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment