@remotion/bundler 3.3.44 → 3.3.45

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.
@@ -0,0 +1 @@
1
+ import './setup-environment';
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ require("./setup-environment");
package/dist/bundle.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import type { WebpackOverrideFn } from 'remotion';
2
1
  import webpack from 'webpack';
2
+ import type { WebpackOverrideFn } from './types';
3
3
  export declare type LegacyBundleOptions = {
4
4
  webpackOverride?: WebpackOverrideFn;
5
5
  outDir?: string;
@@ -26,10 +26,14 @@ const pre = {
26
26
  const AvailableCompositions = () => {
27
27
  const [comps, setComps] = (0, react_1.useState)(null);
28
28
  (0, react_1.useEffect)(() => {
29
+ if ((0, bundle_mode_1.getBundleMode)().type !== 'evaluation') {
30
+ return;
31
+ }
29
32
  let timeout = null;
30
33
  const check = () => {
31
34
  if (window.ready === true) {
32
- setComps(window.getStaticCompositions());
35
+ const newComps = window.getStaticCompositions();
36
+ setComps(newComps);
33
37
  }
34
38
  else {
35
39
  timeout = setTimeout(check, 250);
@@ -50,7 +54,7 @@ const AvailableCompositions = () => {
50
54
  return ((0, jsx_runtime_1.jsx)("button", { type: "button", onClick: showComps, children: "Click here to see a list of available compositions." }));
51
55
  }
52
56
  return ((0, jsx_runtime_1.jsxs)("div", { children: [comps === null ? (0, jsx_runtime_1.jsx)("p", { children: "Loading compositions..." }) : null, (0, jsx_runtime_1.jsx)("ul", { children: comps === null
53
- ? null
57
+ ? []
54
58
  : comps.map((c) => {
55
59
  return (0, jsx_runtime_1.jsx)("li", { children: c.id }, c.id);
56
60
  }) })] }));
@@ -0,0 +1,19 @@
1
+ import type { HotMiddlewareMessage } from './types';
2
+ declare function eventSourceWrapper(): {
3
+ addMessageListener(fn: (msg: MessageEvent) => void): void;
4
+ };
5
+ declare global {
6
+ interface Window {
7
+ __whmEventSourceWrapper: {
8
+ [key: string]: ReturnType<typeof eventSourceWrapper>;
9
+ };
10
+ __webpack_hot_middleware_reporter__: Reporter;
11
+ }
12
+ }
13
+ declare type Reporter = ReturnType<typeof createReporter>;
14
+ declare function createReporter(): {
15
+ cleanProblemsCache(): void;
16
+ problems(type: 'errors' | 'warnings', obj: HotMiddlewareMessage): boolean;
17
+ success: () => undefined;
18
+ };
19
+ export {};
@@ -0,0 +1,177 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ /* eslint-disable no-console */
4
+ /**
5
+ * Source code is adapted from
6
+ * https://github.com/webpack-contrib/webpack-hot-middleware#readme
7
+ * and rewritten in TypeScript. This file is MIT licensed
8
+ */
9
+ const process_update_1 = require("./process-update");
10
+ const strip_ansi_1 = require("./strip-ansi");
11
+ const types_1 = require("./types");
12
+ if (typeof window === 'undefined') {
13
+ // do nothing
14
+ }
15
+ else if (typeof window.EventSource === 'undefined') {
16
+ console.warn('Unsupported browser: You need a browser that supports EventSource ');
17
+ }
18
+ else {
19
+ connect();
20
+ }
21
+ function eventSourceWrapper() {
22
+ let source;
23
+ let lastActivity = Date.now();
24
+ const listeners = [];
25
+ init();
26
+ const timer = setInterval(() => {
27
+ if (Date.now() - lastActivity > types_1.hotMiddlewareOptions.timeout) {
28
+ handleDisconnect();
29
+ }
30
+ }, types_1.hotMiddlewareOptions.timeout / 2);
31
+ function init() {
32
+ source = new window.EventSource(types_1.hotMiddlewareOptions.path);
33
+ source.onopen = handleOnline;
34
+ source.onerror = handleDisconnect;
35
+ source.onmessage = handleMessage;
36
+ }
37
+ function handleOnline() {
38
+ lastActivity = Date.now();
39
+ }
40
+ function handleMessage(event) {
41
+ lastActivity = Date.now();
42
+ for (let i = 0; i < listeners.length; i++) {
43
+ listeners[i](event);
44
+ }
45
+ }
46
+ function handleDisconnect() {
47
+ clearInterval(timer);
48
+ source.close();
49
+ setTimeout(init, types_1.hotMiddlewareOptions.timeout);
50
+ }
51
+ return {
52
+ addMessageListener(fn) {
53
+ listeners.push(fn);
54
+ },
55
+ };
56
+ }
57
+ function getEventSourceWrapper() {
58
+ if (!window.__whmEventSourceWrapper) {
59
+ window.__whmEventSourceWrapper = {};
60
+ }
61
+ if (!window.__whmEventSourceWrapper[types_1.hotMiddlewareOptions.path]) {
62
+ // cache the wrapper for other entries loaded on
63
+ // the same page with the same hotMiddlewareOptions.path
64
+ window.__whmEventSourceWrapper[types_1.hotMiddlewareOptions.path] =
65
+ eventSourceWrapper();
66
+ }
67
+ return window.__whmEventSourceWrapper[types_1.hotMiddlewareOptions.path];
68
+ }
69
+ function connect() {
70
+ getEventSourceWrapper().addMessageListener(handleMessage);
71
+ function handleMessage(event) {
72
+ if (event.data === '\uD83D\uDC93') {
73
+ return;
74
+ }
75
+ try {
76
+ processMessage(JSON.parse(event.data));
77
+ }
78
+ catch (ex) {
79
+ if (types_1.hotMiddlewareOptions.warn) {
80
+ console.warn('Invalid HMR message: ' + event.data + '\n' + ex);
81
+ }
82
+ }
83
+ }
84
+ }
85
+ // the reporter needs to be a singleton on the page
86
+ // in case the client is being used by multiple bundles
87
+ // we only want to report once.
88
+ // all the errors will go to all clients
89
+ const singletonKey = '__webpack_hot_middleware_reporter__';
90
+ let reporter;
91
+ if (typeof window !== 'undefined') {
92
+ if (!window[singletonKey]) {
93
+ window[singletonKey] = createReporter();
94
+ }
95
+ reporter = window[singletonKey];
96
+ }
97
+ function createReporter() {
98
+ const styles = {
99
+ errors: 'color: #ff0000;',
100
+ warnings: 'color: #999933;',
101
+ };
102
+ let previousProblems = null;
103
+ function log(type, obj) {
104
+ if (obj.action === 'building') {
105
+ console.log('[Fast Refresh] Building');
106
+ return;
107
+ }
108
+ const newProblems = obj[type]
109
+ .map((msg) => {
110
+ return (0, strip_ansi_1.stripAnsi)(msg);
111
+ })
112
+ .join('\n');
113
+ if (previousProblems === newProblems) {
114
+ return;
115
+ }
116
+ previousProblems = newProblems;
117
+ const style = styles[type];
118
+ const name = obj.name ? "'" + obj.name + "' " : '';
119
+ const title = '[Fast Refresh] bundle ' + name + 'has ' + obj[type].length + ' ' + type;
120
+ // NOTE: console.warn or console.error will print the stack trace
121
+ // which isn't helpful here, so using console.log to escape it.
122
+ if (console.group && console.groupEnd) {
123
+ console.group('%c' + title, style);
124
+ console.log('%c' + newProblems, style);
125
+ console.groupEnd();
126
+ }
127
+ else {
128
+ console.log('%c' + title + '\n\t%c' + newProblems.replace(/\n/g, '\n\t'), style + 'font-weight: bold;', style + 'font-weight: normal;');
129
+ }
130
+ }
131
+ return {
132
+ cleanProblemsCache() {
133
+ previousProblems = null;
134
+ },
135
+ problems(type, obj) {
136
+ if (types_1.hotMiddlewareOptions.warn) {
137
+ log(type, obj);
138
+ }
139
+ return true;
140
+ },
141
+ success: () => undefined,
142
+ };
143
+ }
144
+ function processMessage(obj) {
145
+ var _a, _b;
146
+ switch (obj.action) {
147
+ case 'building':
148
+ (_a = window.remotion_isBuilding) === null || _a === void 0 ? void 0 : _a.call(window);
149
+ break;
150
+ case 'sync':
151
+ case 'built': {
152
+ let applyUpdate = true;
153
+ if (obj.errors.length > 0) {
154
+ if (reporter)
155
+ reporter.problems('errors', obj);
156
+ applyUpdate = false;
157
+ }
158
+ else if (obj.warnings.length > 0) {
159
+ if (reporter) {
160
+ const overlayShown = reporter.problems('warnings', obj);
161
+ applyUpdate = overlayShown;
162
+ }
163
+ }
164
+ else if (reporter) {
165
+ reporter.cleanProblemsCache();
166
+ reporter.success();
167
+ }
168
+ if (applyUpdate) {
169
+ (_b = window.remotion_finishedBuilding) === null || _b === void 0 ? void 0 : _b.call(window);
170
+ (0, process_update_1.processUpdate)(obj.hash, obj.modules, types_1.hotMiddlewareOptions);
171
+ }
172
+ break;
173
+ }
174
+ default:
175
+ break;
176
+ }
177
+ }
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Source code is adapted from
3
+ * https://github.com/webpack-contrib/webpack-hot-middleware#readme
4
+ * and rewritten in TypeScript. This file is MIT licensed
5
+ */
6
+ import type { IncomingMessage, ServerResponse } from 'http';
7
+ import webpack = require('webpack');
8
+ export declare const webpackHotMiddleware: (compiler: webpack.Compiler, logInfo: (str: string) => void) => (req: IncomingMessage, res: ServerResponse, next: () => void) => void;
@@ -0,0 +1,148 @@
1
+ "use strict";
2
+ /**
3
+ * Source code is adapted from
4
+ * https://github.com/webpack-contrib/webpack-hot-middleware#readme
5
+ * and rewritten in TypeScript. This file is MIT licensed
6
+ */
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ exports.webpackHotMiddleware = void 0;
9
+ const url_1 = require("url");
10
+ const types_1 = require("./types");
11
+ const pathMatch = function (url, path) {
12
+ try {
13
+ return (0, url_1.parse)(url).pathname === path;
14
+ }
15
+ catch (e) {
16
+ return false;
17
+ }
18
+ };
19
+ const webpackHotMiddleware = (compiler, logInfo) => {
20
+ const eventStream = createEventStream(types_1.hotMiddlewareOptions.heartbeat);
21
+ let latestStats = null;
22
+ compiler.hooks.invalid.tap('remotion', onInvalid);
23
+ compiler.hooks.done.tap('remotion', onDone);
24
+ function onInvalid() {
25
+ latestStats = null;
26
+ logInfo('Building...');
27
+ eventStream === null || eventStream === void 0 ? void 0 : eventStream.publish({
28
+ action: 'building',
29
+ });
30
+ }
31
+ function onDone(statsResult) {
32
+ // Keep hold of latest stats so they can be propagated to new clients
33
+ latestStats = statsResult;
34
+ publishStats('built', latestStats, eventStream);
35
+ }
36
+ const middleware = function (req, res, next) {
37
+ if (!pathMatch(req.url, types_1.hotMiddlewareOptions.path))
38
+ return next();
39
+ eventStream === null || eventStream === void 0 ? void 0 : eventStream.handler(req, res);
40
+ if (latestStats) {
41
+ publishStats('sync', latestStats, eventStream);
42
+ }
43
+ };
44
+ return middleware;
45
+ };
46
+ exports.webpackHotMiddleware = webpackHotMiddleware;
47
+ function createEventStream(heartbeat) {
48
+ let clientId = 0;
49
+ let clients = {};
50
+ function everyClient(fn) {
51
+ Object.keys(clients).forEach((id) => {
52
+ fn(clients[id]);
53
+ });
54
+ }
55
+ const interval = setInterval(() => {
56
+ everyClient((client) => {
57
+ client.write('data: \uD83D\uDC93\n\n');
58
+ });
59
+ }, heartbeat).unref();
60
+ return {
61
+ close() {
62
+ clearInterval(interval);
63
+ everyClient((client) => {
64
+ if (!client.finished)
65
+ client.end();
66
+ });
67
+ clients = {};
68
+ },
69
+ handler(req, res) {
70
+ const headers = {
71
+ 'Access-Control-Allow-Origin': '*',
72
+ 'Content-Type': 'text/event-stream;charset=utf-8',
73
+ 'Cache-Control': 'no-cache, no-transform',
74
+ };
75
+ const isHttp1 = !(parseInt(req.httpVersion, 10) >= 2);
76
+ if (isHttp1) {
77
+ req.socket.setKeepAlive(true);
78
+ Object.assign(headers, {
79
+ Connection: 'keep-alive',
80
+ });
81
+ }
82
+ res.writeHead(200, headers);
83
+ res.write('\n');
84
+ const id = clientId++;
85
+ clients[id] = res;
86
+ req.on('close', () => {
87
+ if (!res.finished)
88
+ res.end();
89
+ delete clients[id];
90
+ });
91
+ },
92
+ publish(payload) {
93
+ everyClient((client) => {
94
+ client.write('data: ' + JSON.stringify(payload) + '\n\n');
95
+ });
96
+ },
97
+ };
98
+ }
99
+ function publishStats(action, statsResult, eventStream) {
100
+ const stats = statsResult.toJson({
101
+ all: false,
102
+ cached: true,
103
+ children: true,
104
+ modules: true,
105
+ timings: true,
106
+ hash: true,
107
+ });
108
+ // For multi-compiler, stats will be an object with a 'children' array of stats
109
+ const bundles = extractBundles(stats);
110
+ bundles.forEach((_stats) => {
111
+ let name = _stats.name || '';
112
+ // Fallback to compilation name in case of 1 bundle (if it exists)
113
+ if (bundles.length === 1 && !name && statsResult.compilation) {
114
+ name = statsResult.compilation.name || '';
115
+ }
116
+ eventStream === null || eventStream === void 0 ? void 0 : eventStream.publish({
117
+ name,
118
+ action,
119
+ time: _stats.time,
120
+ hash: _stats.hash,
121
+ warnings: _stats.warnings || [],
122
+ errors: _stats.errors || [],
123
+ modules: buildModuleMap(_stats.modules),
124
+ });
125
+ });
126
+ }
127
+ function extractBundles(stats) {
128
+ var _a;
129
+ // Stats has modules, single bundle
130
+ if (stats.modules)
131
+ return [stats];
132
+ // Stats has children, multiple bundles
133
+ if ((_a = stats.children) === null || _a === void 0 ? void 0 : _a.length)
134
+ return stats.children;
135
+ // Not sure, assume single
136
+ return [stats];
137
+ }
138
+ function buildModuleMap(modules) {
139
+ const map = {};
140
+ if (!modules) {
141
+ return map;
142
+ }
143
+ modules.forEach((module) => {
144
+ const id = module.id;
145
+ map[id] = module.name;
146
+ });
147
+ return map;
148
+ }
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Source code is adapted from
3
+ * https://github.com/webpack-contrib/webpack-hot-middleware#readme
4
+ * and rewritten in TypeScript. This file is MIT licensed
5
+ */
6
+ /**
7
+ * Based heavily on https://github.com/webpack/webpack/blob/
8
+ * c0afdf9c6abc1dd70707c594e473802a566f7b6e/hot/only-dev-server.js
9
+ * Original copyright Tobias Koppers @sokra (MIT license)
10
+ */
11
+ import type { HotMiddlewareOptions, ModuleMap } from './types';
12
+ export declare const processUpdate: (hash: string | undefined, moduleMap: ModuleMap, options: HotMiddlewareOptions) => void;
@@ -0,0 +1,144 @@
1
+ "use strict";
2
+ /* eslint-disable no-console */
3
+ /**
4
+ * Source code is adapted from
5
+ * https://github.com/webpack-contrib/webpack-hot-middleware#readme
6
+ * and rewritten in TypeScript. This file is MIT licensed
7
+ */
8
+ Object.defineProperty(exports, "__esModule", { value: true });
9
+ exports.processUpdate = void 0;
10
+ /* global __webpack_hash__ */
11
+ if (!module.hot) {
12
+ throw new Error('[Fast refresh] Hot Module Replacement is disabled.');
13
+ }
14
+ const hmrDocsUrl = 'https://webpack.js.org/concepts/hot-module-replacement/'; // eslint-disable-line max-len
15
+ let lastHash;
16
+ const failureStatuses = { abort: 1, fail: 1 };
17
+ const applyOptions = {
18
+ ignoreUnaccepted: true,
19
+ ignoreDeclined: true,
20
+ ignoreErrored: true,
21
+ onUnaccepted(data) {
22
+ var _a;
23
+ console.warn('Ignored an update to unaccepted module ' +
24
+ ((_a = data.chain) !== null && _a !== void 0 ? _a : []).join(' -> '));
25
+ },
26
+ onDeclined(data) {
27
+ var _a;
28
+ console.warn('Ignored an update to declined module ' + ((_a = data.chain) !== null && _a !== void 0 ? _a : []).join(' -> '));
29
+ },
30
+ onErrored(data) {
31
+ console.error(data.error);
32
+ console.warn('Ignored an error while updating module ' +
33
+ data.moduleId +
34
+ ' (' +
35
+ data.type +
36
+ ')');
37
+ },
38
+ };
39
+ function upToDate(hash) {
40
+ if (hash)
41
+ lastHash = hash;
42
+ return lastHash === __webpack_hash__;
43
+ }
44
+ const processUpdate = function (hash, moduleMap, options) {
45
+ var _a;
46
+ const { reload } = options;
47
+ if (!upToDate(hash) && ((_a = module.hot) === null || _a === void 0 ? void 0 : _a.status()) === 'idle') {
48
+ check();
49
+ }
50
+ async function check() {
51
+ var _a;
52
+ const cb = function (err, updatedModules) {
53
+ var _a;
54
+ if (err)
55
+ return handleError(err);
56
+ if (!updatedModules) {
57
+ if (options.warn) {
58
+ console.warn('[Fast refresh] Cannot find update (Full reload needed)');
59
+ console.warn('[Fast refresh] (Probably because of restarting the server)');
60
+ }
61
+ performReload();
62
+ return null;
63
+ }
64
+ const applyCallback = function (applyErr, renewedModules) {
65
+ if (applyErr)
66
+ return handleError(applyErr);
67
+ if (!upToDate()) {
68
+ check();
69
+ }
70
+ logUpdates(updatedModules, renewedModules);
71
+ };
72
+ const applyResult = (_a = module.hot) === null || _a === void 0 ? void 0 : _a.apply(applyOptions, applyCallback);
73
+ if (applyResult === null || applyResult === void 0 ? void 0 : applyResult.then) {
74
+ // HotModuleReplacement.runtime.js refers to the result as `outdatedModules`
75
+ applyResult
76
+ .then((outdatedModules) => {
77
+ applyCallback(null, outdatedModules);
78
+ })
79
+ .catch((_err) => applyCallback(_err, []));
80
+ }
81
+ };
82
+ try {
83
+ const result = await ((_a = module.hot) === null || _a === void 0 ? void 0 : _a.check(false, cb));
84
+ cb(null, result);
85
+ }
86
+ catch (err) {
87
+ cb(err, []);
88
+ }
89
+ }
90
+ function logUpdates(updatedModules, renewedModules) {
91
+ var _a;
92
+ const unacceptedModules = (_a = updatedModules === null || updatedModules === void 0 ? void 0 : updatedModules.filter((moduleId) => {
93
+ return renewedModules && renewedModules.indexOf(moduleId) < 0;
94
+ })) !== null && _a !== void 0 ? _a : [];
95
+ if (unacceptedModules.length > 0) {
96
+ if (options.warn) {
97
+ console.warn("[Fast refresh] The following modules couldn't be hot updated: " +
98
+ '(Full reload needed)\n' +
99
+ 'This is usually because the modules which have changed ' +
100
+ '(and their parents) do not know how to hot reload themselves. ' +
101
+ 'See ' +
102
+ hmrDocsUrl +
103
+ ' for more details.');
104
+ unacceptedModules.forEach((moduleId) => {
105
+ console.warn('[Fast refresh] - ' + (moduleMap[moduleId] || moduleId));
106
+ });
107
+ }
108
+ performReload();
109
+ return;
110
+ }
111
+ if (!renewedModules || renewedModules.length === 0) {
112
+ console.log('[Fast refresh] Nothing hot updated.');
113
+ }
114
+ else {
115
+ renewedModules.forEach((moduleId) => {
116
+ console.log(`[Fast refresh] ${moduleMap[moduleId] || moduleId} fast refreshed.`);
117
+ });
118
+ }
119
+ }
120
+ function handleError(err) {
121
+ var _a, _b;
122
+ if (((_b = (_a = module.hot) === null || _a === void 0 ? void 0 : _a.status()) !== null && _b !== void 0 ? _b : 'nope') in failureStatuses) {
123
+ if (options.warn) {
124
+ console.warn('[Fast refresh] Cannot check for update (Full reload needed)');
125
+ console.warn('[Fast refresh] ' + (err.stack || err.message));
126
+ }
127
+ performReload();
128
+ return;
129
+ }
130
+ if (options.warn) {
131
+ console.warn('[Fast refresh] Update check failed: ' + (err.stack || err.message));
132
+ window.location.reload();
133
+ }
134
+ }
135
+ function performReload() {
136
+ if (!reload) {
137
+ return;
138
+ }
139
+ if (options.warn)
140
+ console.warn('[Fast refresh] Reloading page');
141
+ window.location.reload();
142
+ }
143
+ };
144
+ exports.processUpdate = processUpdate;
@@ -0,0 +1 @@
1
+ export declare const stripAnsi: (str: string) => string;
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.stripAnsi = void 0;
4
+ /**
5
+ * Code inlined from https://github.com/chalk/strip-ansi#readme
6
+ * This file is MIT licensed.
7
+ */
8
+ const ansiRegex = () => {
9
+ const pattern = [
10
+ '[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)',
11
+ '(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]))',
12
+ ].join('|');
13
+ return new RegExp(pattern, 'g');
14
+ };
15
+ const stripAnsi = (str) => {
16
+ if (typeof str !== 'string') {
17
+ throw new TypeError(`Expected a \`string\`, got \`${typeof str}\``);
18
+ }
19
+ return str.replace(ansiRegex(), '');
20
+ };
21
+ exports.stripAnsi = stripAnsi;
@@ -0,0 +1,27 @@
1
+ import webpack = require('webpack');
2
+ export declare type HotMiddlewareMessage = {
3
+ action: 'building';
4
+ name?: string;
5
+ } | {
6
+ action: 'built' | 'sync';
7
+ name: string;
8
+ time: number | undefined;
9
+ errors: unknown[];
10
+ warnings: unknown[];
11
+ hash: string | undefined;
12
+ modules: {
13
+ [key: string]: string;
14
+ };
15
+ };
16
+ export declare const hotMiddlewareOptions: {
17
+ path: string;
18
+ timeout: number;
19
+ reload: boolean;
20
+ warn: boolean;
21
+ heartbeat: number;
22
+ };
23
+ export declare type HotMiddlewareOptions = typeof hotMiddlewareOptions;
24
+ export declare type WebpackStats = ReturnType<webpack.Stats['toJson']>;
25
+ export declare type ModuleMap = {
26
+ [key: string]: string;
27
+ };
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.hotMiddlewareOptions = void 0;
4
+ exports.hotMiddlewareOptions = {
5
+ path: '/__webpack_hmr',
6
+ timeout: 20 * 1000,
7
+ reload: true,
8
+ warn: true,
9
+ heartbeat: 10 * 1000,
10
+ };
package/dist/index.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ import type { WebpackOverrideFn } from './types';
1
2
  import esbuild = require('esbuild');
2
3
  import webpack = require('webpack');
3
4
  export declare const BundlerInternals: {
@@ -7,7 +8,7 @@ export declare const BundlerInternals: {
7
8
  userDefinedComponent: string;
8
9
  outDir: string;
9
10
  environment: "development" | "production";
10
- webpackOverride: import("remotion/dist/internals").WebpackOverrideFn;
11
+ webpackOverride: WebpackOverrideFn;
11
12
  onProgress?: ((f: number) => void) | undefined;
12
13
  enableCaching?: boolean | undefined;
13
14
  envVariables: Record<string, string>;
@@ -48,5 +49,10 @@ export declare const BundlerInternals: {
48
49
  }) => import("remotion").StaticFile[];
49
50
  };
50
51
  export { bundle, BundleOptions, LegacyBundleOptions } from './bundle';
52
+ export { WebpackConfiguration, WebpackOverrideFn } from './types';
51
53
  export { webpack };
52
- export declare type WebpackConfiguration = webpack.Configuration;
54
+ declare global {
55
+ interface RemotionBundlingOptions {
56
+ readonly overrideWebpackConfig: (f: WebpackOverrideFn) => void;
57
+ }
58
+ }
package/dist/index.js CHANGED
@@ -3,12 +3,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.webpack = exports.bundle = exports.BundlerInternals = void 0;
4
4
  const bundle_1 = require("./bundle");
5
5
  const index_html_1 = require("./index-html");
6
+ const read_recursively_1 = require("./read-recursively");
6
7
  const webpack_cache_1 = require("./webpack-cache");
7
8
  const webpack_config_1 = require("./webpack-config");
8
9
  const esbuild = require("esbuild");
9
10
  const webpack = require("webpack");
10
11
  exports.webpack = webpack;
11
- const read_recursively_1 = require("./read-recursively");
12
12
  exports.BundlerInternals = {
13
13
  esbuild,
14
14
  webpackConfig: webpack_config_1.webpackConfig,
@@ -0,0 +1,4 @@
1
+ import './fast-refresh/runtime';
2
+ import './setup-environment';
3
+ import './hot-middleware/client';
4
+ import './error-overlay/entry-basic.js';
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ // organize-imports-ignore
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ // Fast Refresh must come first,
5
+ // because setup-environment imports ReactDOM.
6
+ // If React DOM is imported before Fast Refresh, Fast Refresh does not work
7
+ require("./fast-refresh/runtime");
8
+ require("./setup-environment");
9
+ require("./hot-middleware/client");
10
+ require("./error-overlay/entry-basic.js");
@@ -0,0 +1,3 @@
1
+ import webpack = require('webpack');
2
+ export declare type WebpackConfiguration = webpack.Configuration;
3
+ export declare type WebpackOverrideFn = (currentConfiguration: WebpackConfiguration) => WebpackConfiguration;
package/dist/types.js ADDED
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,4 +1,4 @@
1
- import type { WebpackConfiguration, WebpackOverrideFn } from 'remotion';
1
+ import type { WebpackConfiguration, WebpackOverrideFn } from './types';
2
2
  export declare const webpackConfig: ({ entry, userDefinedComponent, outDir, environment, webpackOverride, onProgress, enableCaching, envVariables, maxTimelineTracks, entryPoints, remotionRoot, keyboardShortcutsEnabled, poll, }: {
3
3
  entry: string;
4
4
  userDefinedComponent: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@remotion/bundler",
3
- "version": "3.3.44",
3
+ "version": "3.3.45",
4
4
  "description": "Bundler for Remotion",
5
5
  "main": "dist/index.js",
6
6
  "sideEffects": false,
@@ -26,7 +26,7 @@
26
26
  "css-loader": "5.2.7",
27
27
  "esbuild": "0.16.12",
28
28
  "react-refresh": "0.9.0",
29
- "remotion": "3.3.44",
29
+ "remotion": "3.3.45",
30
30
  "style-loader": "2.0.0",
31
31
  "webpack": "5.74.0"
32
32
  },
@@ -64,5 +64,5 @@
64
64
  "publishConfig": {
65
65
  "access": "public"
66
66
  },
67
- "gitHead": "7ba7bbdacbda1499ecdb92f1d9581d5db458edf8"
67
+ "gitHead": "75c028236b43ff2fd0f3f3772f9f79cfde069e36"
68
68
  }