File: dont-build-browser-module.diff

package info (click to toggle)
node-rollup 3.15.0-1%2Bdeb12u1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 51,264 kB
  • sloc: javascript: 108,994; sh: 26; makefile: 18
file content (84 lines) | stat: -rw-r--r-- 2,517 bytes parent folder | download
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
Description: don't build browser module
Author: Yadd <yadd@debian.org>
Forwarded: not-needed
Last-Update: 2023-01-31

--- a/rollup.config.ts
+++ b/rollup.config.ts
@@ -4,7 +4,6 @@
 import commonjs from '@rollup/plugin-commonjs';
 import json from '@rollup/plugin-json';
 import { nodeResolve } from '@rollup/plugin-node-resolve';
-import terser from '@rollup/plugin-terser';
 import typescript from '@rollup/plugin-typescript';
 import type { Plugin, RollupOptions, WarningHandlerWithDefault } from 'rollup';
 import { string } from 'rollup-plugin-string';
@@ -17,7 +16,6 @@
 import esmDynamicImport from './build-plugins/esm-dynamic-import';
 import getLicenseHandler from './build-plugins/generate-license-file';
 import getBanner from './build-plugins/get-banner';
-import replaceBrowserModules from './build-plugins/replace-browser-modules';
 
 const resOpt = {
   modulePaths: ['./node_modules', 'debian/build_modules'], preferBuiltins: true,
@@ -56,7 +54,7 @@
 export default async function (
 	command: Record<string, unknown>
 ): Promise<RollupOptions | RollupOptions[]> {
-	const { collectLicenses, writeLicense } = getLicenseHandler(
+	const { collectLicenses } = getLicenseHandler(
 		fileURLToPath(new URL('.', import.meta.url))
 	);
 
@@ -110,50 +108,5 @@
 		plugins: [...nodePlugins, emitModulePackageFile(), collectLicenses()]
 	};
 
-
-	const browserBuilds: RollupOptions = {
-		input: 'src/browser-entry.ts',
-		onwarn,
-		output: [
-			{
-				banner: getBanner,
-				file: 'browser/dist/rollup.browser.js',
-				format: 'umd',
-				name: 'rollup',
-				plugins: [copyTypes('rollup.browser.d.ts')],
-				sourcemap: true
-			},
-			{
-				banner: getBanner,
-				file: 'browser/dist/es/rollup.browser.js',
-				format: 'es',
-				plugins: [emitModulePackageFile()]
-			}
-		],
-		plugins: [
-			replaceBrowserModules(),
-			alias(moduleAliases),
-			nodeResolve({ ...resOpt, browser: true }),
-			json(),
-			commonjs(),
-			typescript(),
-			terser({ module: true, output: { comments: 'some' } }),
-			collectLicensesBrowser(),
-			writeLicenseBrowser(),
-			cleanBeforeWrite('browser/dist'),
-			{
-				closeBundle() {
-					// On CI, MacOS runs sometimes do not close properly. This is a hack
-					// to fix this until the problem is understood.
-					console.log('Force quit.');
-					setTimeout(() => exit(0));
-				},
-				name: 'force-close'
-			}
-		],
-		strictDeprecations: true,
-		treeshake
-	};
-
-	return [commonJSBuild, esmBuild, browserBuilds];
+	return [commonJSBuild, esmBuild];
 }