parcel-plugin-imagemin
Version:
Parcel plugin to support image minification
25 lines (22 loc) • 513 B
JavaScript
const Bundler = require('parcel-bundler');
const path = require('path');
const SveltePlugin = require('../lib/index');
async function setupBundler(input, options) {
const bundler = new Bundler(
input,
Object.assign(
{
outDir: path.join(__dirname, 'dist'),
watch: false,
cache: false,
hmr: false,
logLevel: 0,
publicUrl: './'
},
options
)
);
await SveltePlugin(bundler);
return bundler;
}
exports.setupBundler = setupBundler;