Skip to content

Commit

Permalink
Provide a variant that does not bundle the HMAC library, fixes #504
Browse files Browse the repository at this point in the history
  • Loading branch information
hectorm committed Jun 2, 2024
1 parent 303a015 commit fbaa302
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions rollup.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -78,12 +78,24 @@ export default () => {
},
};

/** @type {RollupOptions} */
const rollupSlimOpts = {
...rollupOpts,
external: [/^@noble\/hashes(\/.+)?$/],
};

/** @type {RollupOptions} */
const rollupMinOpts = {
...rollupOpts,
plugins: [rollupOpts.plugins, t(terser)(terserOpts)],
};

/** @type {RollupOptions} */
const rollupSlimMinOpts = {
...rollupMinOpts,
external: [/^@noble\/hashes(\/.+)?$/],
};

/** @type {RollupOptions} */
const rollupNodeOpts = {
plugins: [
Expand Down Expand Up @@ -160,6 +172,16 @@ export default () => {
{ ...outputMinOpts, file: "./dist/otpauth.umd.min.js", format: "umd" },
],
},
{
...rollupSlimOpts,
input: "./src/index.js",
output: [{ ...outputOpts, file: "./dist/otpauth.slim.esm.js", format: "es" }],
},
{
...rollupSlimMinOpts,
input: "./src/index.js",
output: [{ ...outputMinOpts, file: "./dist/otpauth.slim.esm.min.js", format: "es" }],
},
{
...rollupNodeOpts,
input: "./src/index.js",
Expand Down

0 comments on commit fbaa302

Please sign in to comment.