dom-to-pptx 1.0.4 → 1.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dom-to-pptx",
3
- "version": "1.0.4",
3
+ "version": "1.0.5",
4
4
  "description": "A client-side library that converts any HTML element into a fully editable PowerPoint slide. **dom-to-pptx** transforms DOM structures into pixel-accurate `.pptx` content, preserving gradients, shadows, rounded images, and responsive layouts. It translates CSS Flexbox/Grid, linear-gradients, box-shadows, and typography into native PowerPoint shapes, enabling precise, design-faithful slide generation directly from the browser.",
5
5
  "main": "dist/dom-to-pptx.cjs",
6
6
  "module": "dist/dom-to-pptx.mjs",
package/rollup.config.js CHANGED
@@ -1,23 +1,23 @@
1
1
  import resolve from '@rollup/plugin-node-resolve';
2
2
  import commonjs from '@rollup/plugin-commonjs';
3
3
 
4
- export default {
5
- input: 'src/index.js',
4
+ const input = 'src/index.js';
5
+
6
+ // Config A: produce module (mjs), cjs and a lightweight UMD that keeps `pptxgenjs` external.
7
+ const configModules = {
8
+ input,
6
9
  output: [
7
- // ESM build for modern bundlers
8
10
  {
9
11
  file: 'dist/dom-to-pptx.mjs',
10
12
  format: 'es',
11
13
  sourcemap: false,
12
14
  },
13
- // CommonJS build for Node / require()
14
15
  {
15
16
  file: 'dist/dom-to-pptx.cjs',
16
17
  format: 'cjs',
17
18
  sourcemap: false,
18
19
  exports: 'named',
19
20
  },
20
- // UMD build for direct browser usage via script tag (lightweight, keeps pptxgenjs external)
21
21
  {
22
22
  file: 'dist/dom-to-pptx.min.js',
23
23
  format: 'umd',
@@ -27,18 +27,27 @@ export default {
27
27
  pptxgenjs: 'PptxGenJS',
28
28
  },
29
29
  },
30
- // Full standalone bundle (includes dependencies) — use this when you want a single <script> to work
31
- {
32
- file: 'dist/dom-to-pptx.bundle.js',
33
- format: 'umd',
34
- name: 'domToPptx',
35
- esModule: false,
36
- sourcemap: false,
37
- },
38
30
  ],
39
31
  plugins: [resolve(), commonjs()],
40
- // Keep conventional UMD/min file compatible with consumers that already load pptxgenjs separately.
41
- // For the standalone `dist/dom-to-pptx.bundle.js` we must NOT mark dependencies as external so Rollup will
42
- // include them. Therefore leave the external list empty (no externals).
32
+ // Keep pptxgenjs external for module builds so bundlers like Vite don't attempt to resolve Node-only
33
+ // builtins that may be present in pptxgenjs; consumers should install `pptxgenjs` alongside this package
34
+ // when using ESM/CJS builds.
35
+ external: ['pptxgenjs'],
36
+ };
37
+
38
+ // Config B: produce a single standalone UMD bundle that includes dependencies (for script-tag consumers).
39
+ const configBundle = {
40
+ input,
41
+ output: {
42
+ file: 'dist/dom-to-pptx.bundle.js',
43
+ format: 'umd',
44
+ name: 'domToPptx',
45
+ esModule: false,
46
+ sourcemap: false,
47
+ },
48
+ plugins: [resolve(), commonjs()],
49
+ // Bundle everything for the standalone artifact.
43
50
  external: [],
44
51
  };
52
+
53
+ export default [configModules, configBundle];