mirror of
https://github.com/yugasun/qrcode-decoder.git
synced 2026-08-12 20:27:56 +08:00
chore: add type definition
This commit is contained in:
@@ -59,6 +59,25 @@ async function bundleUmd() {
|
||||
});
|
||||
}
|
||||
|
||||
async function bundleCommonjs() {
|
||||
const bundle = await rollup.rollup({
|
||||
input: path.join(process.cwd(), 'src/index.ts'),
|
||||
plugins: [...plugins],
|
||||
external: ['jsqr'],
|
||||
});
|
||||
await bundle.write({
|
||||
file: 'dist/index.js',
|
||||
exports: 'named',
|
||||
name: 'QrcodeDecoder',
|
||||
format: 'commonjs',
|
||||
sourcemap: false,
|
||||
globals: {
|
||||
jsqr: 'jsqr',
|
||||
tslib: 'tslib',
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
async function bundleAio() {
|
||||
const bundle = await rollup.rollup({
|
||||
input: path.join(process.cwd(), 'src/index.ts'),
|
||||
@@ -100,6 +119,14 @@ async function bundle() {
|
||||
await bundleUmd();
|
||||
}
|
||||
|
||||
if (outputs.indexOf('commonjs') === -1) {
|
||||
logBundle(`Skipping commonjs`);
|
||||
} else {
|
||||
logBundle(`Creating commonjs`);
|
||||
|
||||
await bundleCommonjs();
|
||||
}
|
||||
|
||||
if (outputs.indexOf('aio') === -1) {
|
||||
logBundle(`Skipping umd aio`);
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user