File: build-complete-cjs-files.patch

package info (click to toggle)
node-buble 0.20.0%2B~0.20.5-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,336 kB
  • sloc: javascript: 12,767; makefile: 30; sh: 12
file content (68 lines) | stat: -rw-r--r-- 1,444 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
Description: include dependencies in CJS build
Author: Yadd <yadd@debian.org>
Forwarded: not-needed
Last-Update: 2022-11-02

--- a/rollup.config.js
+++ b/rollup.config.js
@@ -6,16 +6,27 @@
 	createConfig({
 		output: [
 			{ format: 'es', file: pkg.module },
-			{ format: 'cjs', file: pkg.main }
 		],
 	}),
+  createConfig({
+    output: [
+			{ format: 'cjs', file: pkg.main },
+    ],
+    noExternal: true,
+  }),
 	/* browser ESM/CJS builds (for bundlers) */
 	createConfig({
 		browser: true,
 		output: [
 			{ format: 'es', file: pkg.browser[pkg.module] },
+		],
+	}),
+	createConfig({
+		browser: true,
+		output: [
 			{ format: 'cjs', file: pkg.browser[pkg.main] }
 		],
+    noExternal: true,
 	}),
 ];
 
--- a/rollup.create-config.js
+++ b/rollup.create-config.js
@@ -12,13 +12,12 @@
 	const external = opts.external || Object.keys(pkg.dependencies || {});
 	const output = ensureArray(opts.output);
 
-	return {
+	const res = {
 		input: 'src/index.js',
 		output: output.map(format => Object.assign({}, format, {
 			name: 'buble',
 			sourcemap: true
 		})),
-		external: external,
 		plugins: [
 			json(),
 			commonjs({ extensions: ['.js', '.mjs'] }),
@@ -36,9 +35,13 @@
 					dangerousForOf: true
 				}
 			}),
-			resolve()
+			resolve({
+        modulePaths: ['/usr/share/nodejs','node_modules'],
+      })
 		],
 	};
+  if (!opts.noExternal) res.external= external;
+  return res;
 };
 
 module.exports = createConfig;