Skip to content

Commit

Permalink
fix: added browser module building support
Browse files Browse the repository at this point in the history
  • Loading branch information
privateOmega committed Jun 5, 2021
1 parent e167696 commit 343867a
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import json from '@rollup/plugin-json';
import commonjs from '@rollup/plugin-commonjs';
import { terser } from 'rollup-plugin-terser';
import cleaner from 'rollup-plugin-cleaner';
import builtins from 'rollup-plugin-node-builtins';

import * as meta from './package.json';

Expand All @@ -18,17 +19,17 @@ export default {
'xmlbuilder2',
],
plugins: [
resolve(),
resolve({ browser: true }),
json({ include: 'package.json', preferConst: true }),
commonjs(),
builtins(),
terser({
mangle: false,
}),
cleaner({
targets: ['./dist/'],
}),
],

output: [
{
file: 'dist/html-to-docx.esm.js',
Expand All @@ -39,8 +40,9 @@ export default {
}`,
},
{
file: 'dist/html-to-docx.cjs.js',
format: 'cjs',
file: 'dist/html-to-docx.umd.js',
format: 'umd',
name: 'HTMLToDOCX',
sourcemap: true,
banner: `// ${meta.homepage} v${meta.version} Copyright ${new Date().getFullYear()} ${
meta.author
Expand Down

0 comments on commit 343867a

Please sign in to comment.