mirror of
https://github.com/flozz/StackBlur.git
synced 2026-01-18 14:18:38 +00:00
- Build: As per latest devDeps. - Docs: Update API docs as per latest - npm: Switch to server without reported vulnerabilities - npm: Switch to pnpm lock - npm: Update devDeps (and switch to new ash-nazg peerDeps) - npm: Bump to 2.5.0
46 lines
1.1 KiB
JavaScript
46 lines
1.1 KiB
JavaScript
import babel from '@rollup/plugin-babel';
|
|
import {terser} from 'rollup-plugin-terser';
|
|
|
|
/**
|
|
* @external RollupConfig
|
|
* @type {PlainObject}
|
|
* @see {@link https://rollupjs.org/guide/en#big-list-of-options}
|
|
*/
|
|
|
|
/**
|
|
* @param {PlainObject} [config={}]
|
|
* @param {boolean} [config.minifying]
|
|
* @param {string} [config.format="umd"]
|
|
* @returns {external:RollupConfig}
|
|
*/
|
|
function getRollupObject ({minifying, format = 'umd'} = {}) {
|
|
const nonMinified = {
|
|
input: 'src/stackblur.js',
|
|
output: {
|
|
format,
|
|
sourcemap: minifying,
|
|
file: `dist/stackblur${format === 'es'
|
|
? '-' + format
|
|
: ''}${minifying ? '.min' : ''}.js`,
|
|
name: 'StackBlur'
|
|
},
|
|
plugins: [
|
|
babel({
|
|
babelHelpers: 'bundled'
|
|
})
|
|
]
|
|
};
|
|
if (minifying) {
|
|
nonMinified.plugins.push(terser());
|
|
}
|
|
return nonMinified;
|
|
}
|
|
|
|
// eslint-disable-next-line import/no-anonymous-default-export -- Rollup config
|
|
export default [
|
|
getRollupObject({minifying: false, format: 'umd'}),
|
|
getRollupObject({minifying: false, format: 'es'}),
|
|
getRollupObject({minifying: true, format: 'umd'}),
|
|
getRollupObject({minifying: true, format: 'es'})
|
|
];
|