@remotion/bundler 4.0.496 → 4.0.498
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/dist/bundle.d.ts +6 -4
- package/dist/bundle.js +41 -34
- package/dist/index.d.ts +8 -18
- package/dist/override-types.d.ts +11 -0
- package/dist/override-types.js +2 -0
- package/dist/rspack-config.d.ts +5 -10
- package/dist/rspack-config.js +5 -16
- package/dist/webpack-config.d.ts +5 -10
- package/dist/webpack-config.js +5 -13
- package/package.json +7 -7
package/dist/bundle.d.ts
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
import type { GitSource, RenderDefaults } from '@remotion/studio-shared';
|
|
2
2
|
import webpack from 'webpack';
|
|
3
|
-
import type { WebpackOverrideFn } from './
|
|
3
|
+
import type { BundlerOverrideFn, RspackOverrideFn, WebpackOverrideFn } from './override-types';
|
|
4
|
+
export declare const getBundlePublicPath: (publicPath: string | null) => string;
|
|
5
|
+
export declare const getBundleStaticHash: (publicPath: string) => string;
|
|
4
6
|
export type MandatoryLegacyBundleOptions = {
|
|
7
|
+
bundlerOverride?: BundlerOverrideFn;
|
|
8
|
+
rspackOverride?: RspackOverrideFn;
|
|
5
9
|
webpackOverride: WebpackOverrideFn;
|
|
6
10
|
outDir: string | null;
|
|
7
11
|
enableCaching: boolean;
|
|
@@ -23,12 +27,10 @@ export type MandatoryLegacyBundleOptions = {
|
|
|
23
27
|
symlinkPublicDir: boolean;
|
|
24
28
|
};
|
|
25
29
|
export type LegacyBundleOptions = Partial<MandatoryLegacyBundleOptions>;
|
|
26
|
-
export declare const getConfig: ({ entryPoint, outDir, resolvedRemotionRoot, onProgress, options,
|
|
30
|
+
export declare const getConfig: ({ entryPoint, outDir, resolvedRemotionRoot, onProgress, options, }: {
|
|
27
31
|
outDir: string;
|
|
28
32
|
entryPoint: string;
|
|
29
33
|
resolvedRemotionRoot: string;
|
|
30
|
-
bufferStateDelayInMilliseconds: number | null;
|
|
31
|
-
maxTimelineTracks: number | null;
|
|
32
34
|
onProgress: (progress: number) => void;
|
|
33
35
|
options: MandatoryLegacyBundleOptions;
|
|
34
36
|
}) => Promise<[string, webpack.Configuration]> | Promise<[string, import("@rspack/core").RspackOptions]>;
|
package/dist/bundle.js
CHANGED
|
@@ -36,7 +36,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
36
36
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
37
37
|
};
|
|
38
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
-
exports.internalBundle = exports.findClosestFolderWithItem = exports.getConfig = void 0;
|
|
39
|
+
exports.internalBundle = exports.findClosestFolderWithItem = exports.getConfig = exports.getBundleStaticHash = exports.getBundlePublicPath = void 0;
|
|
40
40
|
exports.bundle = bundle;
|
|
41
41
|
const node_fs_1 = __importStar(require("node:fs"));
|
|
42
42
|
const node_os_1 = __importDefault(require("node:os"));
|
|
@@ -86,25 +86,36 @@ const trimTrailingSlash = (p) => {
|
|
|
86
86
|
}
|
|
87
87
|
return p;
|
|
88
88
|
};
|
|
89
|
-
const
|
|
90
|
-
|
|
89
|
+
const getBundlePublicPath = (publicPath) => {
|
|
90
|
+
return publicPath !== null && publicPath !== void 0 ? publicPath : './';
|
|
91
|
+
};
|
|
92
|
+
exports.getBundlePublicPath = getBundlePublicPath;
|
|
93
|
+
const getBundleStaticHash = (publicPath) => {
|
|
94
|
+
if (publicPath === './') {
|
|
95
|
+
return './public';
|
|
96
|
+
}
|
|
97
|
+
return ('/' +
|
|
98
|
+
[trimTrailingSlash(trimLeadingSlash(publicPath)), 'public']
|
|
99
|
+
.filter(Boolean)
|
|
100
|
+
.join('/'));
|
|
101
|
+
};
|
|
102
|
+
exports.getBundleStaticHash = getBundleStaticHash;
|
|
103
|
+
const getConfig = ({ entryPoint, outDir, resolvedRemotionRoot, onProgress, options, }) => {
|
|
104
|
+
var _a, _b, _c, _d;
|
|
91
105
|
const configArgs = {
|
|
92
106
|
entry: node_path_1.default.join(require.resolve('@remotion/studio/renderEntry'), '..', 'esm', 'renderEntry.mjs'),
|
|
93
107
|
userDefinedComponent: entryPoint,
|
|
94
108
|
outDir,
|
|
95
109
|
environment: 'production',
|
|
96
|
-
|
|
110
|
+
bundlerOverride: (_a = options === null || options === void 0 ? void 0 : options.bundlerOverride) !== null && _a !== void 0 ? _a : ((f) => f),
|
|
111
|
+
webpackOverride: (_b = options === null || options === void 0 ? void 0 : options.webpackOverride) !== null && _b !== void 0 ? _b : ((f) => f),
|
|
112
|
+
rspackOverride: (_c = options === null || options === void 0 ? void 0 : options.rspackOverride) !== null && _c !== void 0 ? _c : ((f) => f),
|
|
97
113
|
onProgress: (p) => {
|
|
98
114
|
onProgress === null || onProgress === void 0 ? void 0 : onProgress(p);
|
|
99
115
|
},
|
|
100
|
-
enableCaching: (
|
|
101
|
-
maxTimelineTracks,
|
|
116
|
+
enableCaching: (_d = options === null || options === void 0 ? void 0 : options.enableCaching) !== null && _d !== void 0 ? _d : true,
|
|
102
117
|
remotionRoot: resolvedRemotionRoot,
|
|
103
|
-
keyboardShortcutsEnabled: (_c = options === null || options === void 0 ? void 0 : options.keyboardShortcutsEnabled) !== null && _c !== void 0 ? _c : true,
|
|
104
|
-
bufferStateDelayInMilliseconds,
|
|
105
118
|
poll: null,
|
|
106
|
-
askAIEnabled: (_d = options === null || options === void 0 ? void 0 : options.askAIEnabled) !== null && _d !== void 0 ? _d : true,
|
|
107
|
-
interactivityEnabled: (_e = options === null || options === void 0 ? void 0 : options.interactivityEnabled) !== null && _e !== void 0 ? _e : true,
|
|
108
119
|
extraPlugins: [],
|
|
109
120
|
};
|
|
110
121
|
if (options.rspack) {
|
|
@@ -161,7 +172,7 @@ const validateEntryPoint = async (entryPoint) => {
|
|
|
161
172
|
};
|
|
162
173
|
const internalBundle = async (actualArgs) => {
|
|
163
174
|
var _a, _b;
|
|
164
|
-
var _c, _d, _e, _f, _g, _h, _j, _k
|
|
175
|
+
var _c, _d, _e, _f, _g, _h, _j, _k;
|
|
165
176
|
const entryPoint = node_path_1.default.resolve(process.cwd(), actualArgs.entryPoint);
|
|
166
177
|
const resolvedRemotionRoot = (_d = (_c = actualArgs === null || actualArgs === void 0 ? void 0 : actualArgs.rootDir) !== null && _c !== void 0 ? _c : findClosestPackageJsonFolder(entryPoint)) !== null && _d !== void 0 ? _d : process.cwd();
|
|
167
178
|
if (!actualArgs.ignoreRegisterRootWarning) {
|
|
@@ -183,9 +194,6 @@ const internalBundle = async (actualArgs) => {
|
|
|
183
194
|
resolvedRemotionRoot,
|
|
184
195
|
onProgress,
|
|
185
196
|
options,
|
|
186
|
-
// Should be null to keep cache hash working
|
|
187
|
-
bufferStateDelayInMilliseconds: (_f = actualArgs.bufferStateDelayInMilliseconds) !== null && _f !== void 0 ? _f : null,
|
|
188
|
-
maxTimelineTracks: actualArgs.maxTimelineTracks,
|
|
189
197
|
});
|
|
190
198
|
if (actualArgs.rspack) {
|
|
191
199
|
const { rspack: rspackFn } = require('@rspack/core');
|
|
@@ -238,11 +246,8 @@ const internalBundle = async (actualArgs) => {
|
|
|
238
246
|
}
|
|
239
247
|
}
|
|
240
248
|
}
|
|
241
|
-
const publicPath = (
|
|
242
|
-
const staticHash =
|
|
243
|
-
[trimTrailingSlash(trimLeadingSlash(publicPath)), 'public']
|
|
244
|
-
.filter(Boolean)
|
|
245
|
-
.join('/');
|
|
249
|
+
const publicPath = (0, exports.getBundlePublicPath)(actualArgs.publicPath);
|
|
250
|
+
const staticHash = (0, exports.getBundleStaticHash)(publicPath);
|
|
246
251
|
const from = (options === null || options === void 0 ? void 0 : options.publicDir)
|
|
247
252
|
? node_path_1.default.resolve(resolvedRemotionRoot, options.publicDir)
|
|
248
253
|
: node_path_1.default.join(resolvedRemotionRoot, 'public');
|
|
@@ -301,12 +306,12 @@ const internalBundle = async (actualArgs) => {
|
|
|
301
306
|
}),
|
|
302
307
|
includeFavicon: true,
|
|
303
308
|
title: 'Remotion Bundle',
|
|
304
|
-
renderDefaults: (
|
|
309
|
+
renderDefaults: (_f = actualArgs.renderDefaults) !== null && _f !== void 0 ? _f : undefined,
|
|
305
310
|
publicFolderExists: `${publicPath + (publicPath.endsWith('/') ? '' : '/')}public`,
|
|
306
311
|
fileSystemPlatform: null,
|
|
307
|
-
gitSource: (
|
|
312
|
+
gitSource: (_g = actualArgs.gitSource) !== null && _g !== void 0 ? _g : null,
|
|
308
313
|
projectName: (0, studio_shared_1.getProjectName)({
|
|
309
|
-
gitSource: (
|
|
314
|
+
gitSource: (_h = actualArgs.gitSource) !== null && _h !== void 0 ? _h : null,
|
|
310
315
|
resolvedRemotionRoot,
|
|
311
316
|
basename: node_path_1.default.basename,
|
|
312
317
|
}),
|
|
@@ -315,8 +320,8 @@ const internalBundle = async (actualArgs) => {
|
|
|
315
320
|
// Actual log level is set in setPropsAndEnv()
|
|
316
321
|
logLevel: 'info',
|
|
317
322
|
mode: 'bundle',
|
|
318
|
-
audioLatencyHint: (
|
|
319
|
-
sampleRate: (
|
|
323
|
+
audioLatencyHint: (_j = actualArgs.audioLatencyHint) !== null && _j !== void 0 ? _j : 'playback',
|
|
324
|
+
sampleRate: (_k = (_b = actualArgs.renderDefaults) === null || _b === void 0 ? void 0 : _b.sampleRate) !== null && _k !== void 0 ? _k : 48000,
|
|
320
325
|
studioRuntimeConfig: {
|
|
321
326
|
askAIEnabled: actualArgs.askAIEnabled,
|
|
322
327
|
bufferStateDelayInMilliseconds: actualArgs.bufferStateDelayInMilliseconds,
|
|
@@ -331,11 +336,11 @@ const internalBundle = async (actualArgs) => {
|
|
|
331
336
|
};
|
|
332
337
|
exports.internalBundle = internalBundle;
|
|
333
338
|
/*
|
|
334
|
-
* @description Bundles a Remotion project
|
|
339
|
+
* @description Bundles a Remotion project and prepares it for rendering.
|
|
335
340
|
* @see [Documentation](https://remotion.dev/docs/bundle)
|
|
336
341
|
*/
|
|
337
342
|
async function bundle(...args) {
|
|
338
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w;
|
|
343
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y;
|
|
339
344
|
const actualArgs = convertArgumentsIntoOptions(args);
|
|
340
345
|
const result = await (0, exports.internalBundle)({
|
|
341
346
|
bufferStateDelayInMilliseconds: (_a = actualArgs.bufferStateDelayInMilliseconds) !== null && _a !== void 0 ? _a : null,
|
|
@@ -352,14 +357,16 @@ async function bundle(...args) {
|
|
|
352
357
|
publicDir: (_l = actualArgs.publicDir) !== null && _l !== void 0 ? _l : null,
|
|
353
358
|
publicPath: (_m = actualArgs.publicPath) !== null && _m !== void 0 ? _m : null,
|
|
354
359
|
rootDir: (_o = actualArgs.rootDir) !== null && _o !== void 0 ? _o : null,
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
360
|
+
bundlerOverride: (_p = actualArgs.bundlerOverride) !== null && _p !== void 0 ? _p : ((f) => f),
|
|
361
|
+
rspackOverride: (_q = actualArgs.rspackOverride) !== null && _q !== void 0 ? _q : ((f) => f),
|
|
362
|
+
webpackOverride: (_r = actualArgs.webpackOverride) !== null && _r !== void 0 ? _r : ((f) => f),
|
|
363
|
+
audioLatencyHint: (_s = actualArgs.audioLatencyHint) !== null && _s !== void 0 ? _s : null,
|
|
364
|
+
renderDefaults: (_t = actualArgs.renderDefaults) !== null && _t !== void 0 ? _t : null,
|
|
365
|
+
askAIEnabled: (_u = actualArgs.askAIEnabled) !== null && _u !== void 0 ? _u : true,
|
|
366
|
+
interactivityEnabled: (_v = actualArgs.interactivityEnabled) !== null && _v !== void 0 ? _v : true,
|
|
367
|
+
keyboardShortcutsEnabled: (_w = actualArgs.keyboardShortcutsEnabled) !== null && _w !== void 0 ? _w : true,
|
|
368
|
+
rspack: (_x = actualArgs.rspack) !== null && _x !== void 0 ? _x : false,
|
|
369
|
+
symlinkPublicDir: (_y = actualArgs.symlinkPublicDir) !== null && _y !== void 0 ? _y : false,
|
|
363
370
|
});
|
|
364
371
|
return result;
|
|
365
372
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -3,50 +3,40 @@ import esbuild = require('esbuild');
|
|
|
3
3
|
import webpack = require('webpack');
|
|
4
4
|
export declare const BundlerInternals: {
|
|
5
5
|
esbuild: typeof esbuild;
|
|
6
|
-
webpackConfig: ({ entry, userDefinedComponent, outDir, environment, webpackOverride, onProgress, enableCaching,
|
|
6
|
+
webpackConfig: ({ entry, userDefinedComponent, outDir, environment, bundlerOverride, webpackOverride, onProgress, enableCaching, remotionRoot, poll, extraPlugins, }: {
|
|
7
7
|
entry: string;
|
|
8
8
|
userDefinedComponent: string;
|
|
9
9
|
outDir: string | null;
|
|
10
10
|
environment: "development" | "production";
|
|
11
|
-
|
|
11
|
+
bundlerOverride: import("./override-types").BundlerOverrideFn;
|
|
12
|
+
webpackOverride: import("./override-types").WebpackOverrideFn;
|
|
12
13
|
onProgress?: ((f: number) => void) | undefined;
|
|
13
14
|
enableCaching?: boolean | undefined;
|
|
14
|
-
maxTimelineTracks: number | null;
|
|
15
|
-
keyboardShortcutsEnabled: boolean;
|
|
16
|
-
bufferStateDelayInMilliseconds: number | null;
|
|
17
15
|
remotionRoot: string;
|
|
18
16
|
poll: number | null;
|
|
19
|
-
askAIEnabled: boolean;
|
|
20
|
-
interactivityEnabled: boolean;
|
|
21
17
|
extraPlugins: webpack.WebpackPluginInstance[];
|
|
22
18
|
}) => Promise<[string, webpack.Configuration]>;
|
|
23
|
-
rspackConfig: ({ entry, userDefinedComponent, outDir, environment,
|
|
19
|
+
rspackConfig: ({ entry, userDefinedComponent, outDir, environment, bundlerOverride, rspackOverride, onProgress, enableCaching, remotionRoot, poll, extraPlugins, }: {
|
|
24
20
|
entry: string;
|
|
25
21
|
userDefinedComponent: string;
|
|
26
22
|
outDir: string | null;
|
|
27
23
|
environment: "development" | "production";
|
|
28
|
-
|
|
24
|
+
bundlerOverride: import("./override-types").BundlerOverrideFn;
|
|
25
|
+
rspackOverride: import("./override-types").RspackOverrideFn;
|
|
29
26
|
onProgress?: ((f: number) => void) | undefined;
|
|
30
27
|
enableCaching?: boolean | undefined;
|
|
31
|
-
maxTimelineTracks: number | null;
|
|
32
|
-
keyboardShortcutsEnabled: boolean;
|
|
33
|
-
bufferStateDelayInMilliseconds: number | null;
|
|
34
28
|
remotionRoot: string;
|
|
35
29
|
poll: number | null;
|
|
36
|
-
askAIEnabled: boolean;
|
|
37
|
-
interactivityEnabled: boolean;
|
|
38
30
|
extraPlugins: any[];
|
|
39
31
|
}) => Promise<[string, import("@rspack/core").RspackOptions]>;
|
|
40
32
|
createRspackCompiler: (config: import("@rspack/core").RspackOptions) => import("@rspack/core").Compiler;
|
|
41
33
|
indexHtml: ({ publicPath, editorName, inputProps, envVariables, staticHash, remotionRoot, studioServerCommand, renderQueue, completedClientRenders, numberOfAudioTags, publicFiles, includeFavicon, title, renderDefaults, publicFolderExists, fileSystemPlatform, gitSource, projectName, installedDependencies, packageManager, audioLatencyHint, sampleRate, logLevel, mode, bundleScriptUrl, readOnlyStudio, studioRuntimeConfig, }: import("@remotion/studio-shared").StudioHtmlOptions) => string;
|
|
42
34
|
cacheExists: (remotionRoot: string, environment: "development" | "production", hash: string) => "does-not-exist" | "exists" | "other-exists";
|
|
43
35
|
clearCache: (remotionRoot: string, env: "development" | "production") => Promise<void>;
|
|
44
|
-
getConfig: ({ entryPoint, outDir, resolvedRemotionRoot, onProgress, options,
|
|
36
|
+
getConfig: ({ entryPoint, outDir, resolvedRemotionRoot, onProgress, options, }: {
|
|
45
37
|
outDir: string;
|
|
46
38
|
entryPoint: string;
|
|
47
39
|
resolvedRemotionRoot: string;
|
|
48
|
-
bufferStateDelayInMilliseconds: number | null;
|
|
49
|
-
maxTimelineTracks: number | null;
|
|
50
40
|
onProgress: (progress: number) => void;
|
|
51
41
|
options: import("./bundle").MandatoryLegacyBundleOptions;
|
|
52
42
|
}) => Promise<[string, webpack.Configuration]> | Promise<[string, import("@rspack/core").RspackOptions]>;
|
|
@@ -74,6 +64,6 @@ export declare const BundlerInternals: {
|
|
|
74
64
|
};
|
|
75
65
|
export type { GitSource } from '@remotion/studio-shared';
|
|
76
66
|
export { bundle, BundleOptions, LegacyBundleOptions, MandatoryLegacyBundleOptions, } from './bundle';
|
|
77
|
-
export { WebpackConfiguration, WebpackOverrideFn } from './
|
|
67
|
+
export type { BundlerConfiguration, BundlerName, BundlerOverrideFn, RspackConfiguration, RspackOverrideFn, WebpackConfiguration, WebpackOverrideFn, } from './override-types';
|
|
78
68
|
export { WatchIgnoreNextChangePlugin };
|
|
79
69
|
export { webpack };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Configuration as RspackConfigurationType } from '@rspack/core';
|
|
2
|
+
import type { Configuration as WebpackConfigurationType } from 'webpack';
|
|
3
|
+
export type WebpackConfiguration = WebpackConfigurationType;
|
|
4
|
+
export type RspackConfiguration = RspackConfigurationType;
|
|
5
|
+
export type BundlerConfiguration = WebpackConfiguration | RspackConfiguration;
|
|
6
|
+
export type WebpackOverrideFn = (currentConfiguration: WebpackConfiguration) => WebpackConfiguration | Promise<WebpackConfiguration>;
|
|
7
|
+
export type RspackOverrideFn = (currentConfiguration: RspackConfiguration) => RspackConfiguration | Promise<RspackConfiguration>;
|
|
8
|
+
export type BundlerName = 'webpack' | 'rspack';
|
|
9
|
+
export type BundlerOverrideFn = <Configuration extends BundlerConfiguration>(currentConfiguration: Configuration, context: {
|
|
10
|
+
bundler: BundlerName;
|
|
11
|
+
}) => Configuration | Promise<Configuration>;
|
package/dist/rspack-config.d.ts
CHANGED
|
@@ -1,21 +1,16 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
|
|
3
|
-
export
|
|
4
|
-
export declare const rspackConfig: ({ entry, userDefinedComponent, outDir, environment, webpackOverride, onProgress, enableCaching, maxTimelineTracks, remotionRoot, keyboardShortcutsEnabled, bufferStateDelayInMilliseconds, poll, askAIEnabled, interactivityEnabled, extraPlugins, }: {
|
|
1
|
+
import type { BundlerOverrideFn, RspackOverrideFn } from './override-types';
|
|
2
|
+
export type { RspackConfiguration, RspackOverrideFn } from './override-types';
|
|
3
|
+
export declare const rspackConfig: ({ entry, userDefinedComponent, outDir, environment, bundlerOverride, rspackOverride, onProgress, enableCaching, remotionRoot, poll, extraPlugins, }: {
|
|
5
4
|
entry: string;
|
|
6
5
|
userDefinedComponent: string;
|
|
7
6
|
outDir: string | null;
|
|
8
7
|
environment: "development" | "production";
|
|
9
|
-
|
|
8
|
+
bundlerOverride: BundlerOverrideFn;
|
|
9
|
+
rspackOverride: RspackOverrideFn;
|
|
10
10
|
onProgress?: ((f: number) => void) | undefined;
|
|
11
11
|
enableCaching?: boolean | undefined;
|
|
12
|
-
maxTimelineTracks: number | null;
|
|
13
|
-
keyboardShortcutsEnabled: boolean;
|
|
14
|
-
bufferStateDelayInMilliseconds: number | null;
|
|
15
12
|
remotionRoot: string;
|
|
16
13
|
poll: number | null;
|
|
17
|
-
askAIEnabled: boolean;
|
|
18
|
-
interactivityEnabled: boolean;
|
|
19
14
|
extraPlugins: any[];
|
|
20
15
|
}) => Promise<[string, import("@rspack/core").RspackOptions]>;
|
|
21
16
|
export declare const createRspackCompiler: (config: import("@rspack/core").RspackOptions) => import("@rspack/core").Compiler;
|
package/dist/rspack-config.js
CHANGED
|
@@ -7,17 +7,9 @@ exports.createRspackCompiler = exports.rspackConfig = void 0;
|
|
|
7
7
|
const studio_entry_points_1 = require("@remotion/studio-shared/studio-entry-points");
|
|
8
8
|
const core_1 = require("@rspack/core");
|
|
9
9
|
const plugin_react_refresh_1 = __importDefault(require("@rspack/plugin-react-refresh"));
|
|
10
|
-
const define_plugin_definitions_1 = require("./define-plugin-definitions");
|
|
11
10
|
const shared_bundler_config_1 = require("./shared-bundler-config");
|
|
12
|
-
const rspackConfig = async ({ entry, userDefinedComponent, outDir, environment,
|
|
11
|
+
const rspackConfig = async ({ entry, userDefinedComponent, outDir, environment, bundlerOverride = (f) => f, rspackOverride = (f) => f, onProgress, enableCaching = true, remotionRoot, poll, extraPlugins, }) => {
|
|
13
12
|
let lastProgress = 0;
|
|
14
|
-
const define = new core_1.DefinePlugin((0, define_plugin_definitions_1.getDefinePluginDefinitions)({
|
|
15
|
-
maxTimelineTracks,
|
|
16
|
-
askAIEnabled,
|
|
17
|
-
interactivityEnabled,
|
|
18
|
-
keyboardShortcutsEnabled,
|
|
19
|
-
bufferStateDelayInMilliseconds,
|
|
20
|
-
}));
|
|
21
13
|
const swcLoaderRule = {
|
|
22
14
|
loader: 'builtin:swc-loader',
|
|
23
15
|
options: {
|
|
@@ -50,9 +42,7 @@ const rspackConfig = async ({ entry, userDefinedComponent, outDir, environment,
|
|
|
50
42
|
env: { targets: 'Chrome >= 85' },
|
|
51
43
|
},
|
|
52
44
|
};
|
|
53
|
-
|
|
54
|
-
// but the TypeScript types differ. Cast through `any` for the override.
|
|
55
|
-
const conf = (await webpackOverride({
|
|
45
|
+
const baseConfig = {
|
|
56
46
|
...(0, shared_bundler_config_1.getBaseConfig)(environment, poll),
|
|
57
47
|
node: {
|
|
58
48
|
// Suppress the warning in `source-map`
|
|
@@ -74,7 +64,6 @@ const rspackConfig = async ({ entry, userDefinedComponent, outDir, environment,
|
|
|
74
64
|
? [
|
|
75
65
|
new plugin_react_refresh_1.default({ overlay: false }),
|
|
76
66
|
new core_1.rspack.HotModuleReplacementPlugin(),
|
|
77
|
-
define,
|
|
78
67
|
...extraPlugins,
|
|
79
68
|
]
|
|
80
69
|
: [
|
|
@@ -86,7 +75,6 @@ const rspackConfig = async ({ entry, userDefinedComponent, outDir, environment,
|
|
|
86
75
|
}
|
|
87
76
|
}
|
|
88
77
|
}),
|
|
89
|
-
define,
|
|
90
78
|
],
|
|
91
79
|
output: (0, shared_bundler_config_1.getOutputConfig)(environment),
|
|
92
80
|
resolve: (0, shared_bundler_config_1.getResolveConfig)(),
|
|
@@ -116,8 +104,9 @@ const rspackConfig = async ({ entry, userDefinedComponent, outDir, environment,
|
|
|
116
104
|
},
|
|
117
105
|
],
|
|
118
106
|
},
|
|
119
|
-
|
|
120
|
-
})
|
|
107
|
+
};
|
|
108
|
+
const sharedConfig = await bundlerOverride(baseConfig, { bundler: 'rspack' });
|
|
109
|
+
const conf = await rspackOverride(sharedConfig);
|
|
121
110
|
const [hash, finalConf] = (0, shared_bundler_config_1.computeHashAndFinalConfig)(conf, {
|
|
122
111
|
enableCaching,
|
|
123
112
|
environment,
|
package/dist/webpack-config.d.ts
CHANGED
|
@@ -1,21 +1,16 @@
|
|
|
1
|
-
import type { Configuration } from 'webpack';
|
|
2
1
|
import webpack from 'webpack';
|
|
3
|
-
|
|
4
|
-
export type
|
|
5
|
-
export declare const webpackConfig: ({ entry, userDefinedComponent, outDir, environment, webpackOverride, onProgress, enableCaching,
|
|
2
|
+
import type { BundlerOverrideFn, WebpackOverrideFn } from './override-types';
|
|
3
|
+
export type { WebpackConfiguration, WebpackOverrideFn } from './override-types';
|
|
4
|
+
export declare const webpackConfig: ({ entry, userDefinedComponent, outDir, environment, bundlerOverride, webpackOverride, onProgress, enableCaching, remotionRoot, poll, extraPlugins, }: {
|
|
6
5
|
entry: string;
|
|
7
6
|
userDefinedComponent: string;
|
|
8
7
|
outDir: string | null;
|
|
9
8
|
environment: "development" | "production";
|
|
9
|
+
bundlerOverride: BundlerOverrideFn;
|
|
10
10
|
webpackOverride: WebpackOverrideFn;
|
|
11
11
|
onProgress?: ((f: number) => void) | undefined;
|
|
12
12
|
enableCaching?: boolean | undefined;
|
|
13
|
-
maxTimelineTracks: number | null;
|
|
14
|
-
keyboardShortcutsEnabled: boolean;
|
|
15
|
-
bufferStateDelayInMilliseconds: number | null;
|
|
16
13
|
remotionRoot: string;
|
|
17
14
|
poll: number | null;
|
|
18
|
-
askAIEnabled: boolean;
|
|
19
|
-
interactivityEnabled: boolean;
|
|
20
15
|
extraPlugins: webpack.WebpackPluginInstance[];
|
|
21
|
-
}) => Promise<[string, Configuration]>;
|
|
16
|
+
}) => Promise<[string, webpack.Configuration]>;
|
package/dist/webpack-config.js
CHANGED
|
@@ -37,7 +37,6 @@ exports.webpackConfig = void 0;
|
|
|
37
37
|
const studio_entry_points_1 = require("@remotion/studio-shared/studio-entry-points");
|
|
38
38
|
const webpack_1 = __importStar(require("webpack"));
|
|
39
39
|
const case_sensitive_paths_1 = require("./case-sensitive-paths");
|
|
40
|
-
const define_plugin_definitions_1 = require("./define-plugin-definitions");
|
|
41
40
|
const fast_refresh_1 = require("./fast-refresh");
|
|
42
41
|
const hide_expression_dependency_1 = require("./hide-expression-dependency");
|
|
43
42
|
const ignore_packfilecache_warnings_1 = require("./ignore-packfilecache-warnings");
|
|
@@ -47,7 +46,7 @@ const esbuild = require("esbuild");
|
|
|
47
46
|
function truthy(value) {
|
|
48
47
|
return Boolean(value);
|
|
49
48
|
}
|
|
50
|
-
const webpackConfig = async ({ entry, userDefinedComponent, outDir, environment, webpackOverride = (f) => f, onProgress, enableCaching = true,
|
|
49
|
+
const webpackConfig = async ({ entry, userDefinedComponent, outDir, environment, bundlerOverride = (f) => f, webpackOverride = (f) => f, onProgress, enableCaching = true, remotionRoot, poll, extraPlugins, }) => {
|
|
51
50
|
const esbuildLoaderOptions = {
|
|
52
51
|
target: 'chrome85',
|
|
53
52
|
loader: 'tsx',
|
|
@@ -55,14 +54,7 @@ const webpackConfig = async ({ entry, userDefinedComponent, outDir, environment,
|
|
|
55
54
|
remotionRoot,
|
|
56
55
|
};
|
|
57
56
|
let lastProgress = 0;
|
|
58
|
-
const
|
|
59
|
-
maxTimelineTracks,
|
|
60
|
-
askAIEnabled,
|
|
61
|
-
interactivityEnabled,
|
|
62
|
-
keyboardShortcutsEnabled,
|
|
63
|
-
bufferStateDelayInMilliseconds,
|
|
64
|
-
}));
|
|
65
|
-
const conf = await webpackOverride({
|
|
57
|
+
const baseConfig = {
|
|
66
58
|
...(0, shared_bundler_config_1.getBaseConfig)(environment, poll),
|
|
67
59
|
entry: (0, studio_entry_points_1.getStudioEntryPoints)({
|
|
68
60
|
fastRefreshRuntime: environment === 'development'
|
|
@@ -82,7 +74,6 @@ const webpackConfig = async ({ entry, userDefinedComponent, outDir, environment,
|
|
|
82
74
|
new fast_refresh_1.ReactFreshWebpackPlugin(),
|
|
83
75
|
new case_sensitive_paths_1.CaseSensitivePathsPlugin(),
|
|
84
76
|
new webpack_1.default.HotModuleReplacementPlugin(),
|
|
85
|
-
define,
|
|
86
77
|
new optional_dependencies_1.AllowOptionalDependenciesPlugin(),
|
|
87
78
|
new hide_expression_dependency_1.AllowDependencyExpressionPlugin(),
|
|
88
79
|
new ignore_packfilecache_warnings_1.IgnorePackFileCacheWarningsPlugin(),
|
|
@@ -97,7 +88,6 @@ const webpackConfig = async ({ entry, userDefinedComponent, outDir, environment,
|
|
|
97
88
|
}
|
|
98
89
|
}
|
|
99
90
|
}),
|
|
100
|
-
define,
|
|
101
91
|
new optional_dependencies_1.AllowOptionalDependenciesPlugin(),
|
|
102
92
|
new hide_expression_dependency_1.AllowDependencyExpressionPlugin(),
|
|
103
93
|
new ignore_packfilecache_warnings_1.IgnorePackFileCacheWarningsPlugin(),
|
|
@@ -139,7 +129,9 @@ const webpackConfig = async ({ entry, userDefinedComponent, outDir, environment,
|
|
|
139
129
|
},
|
|
140
130
|
],
|
|
141
131
|
},
|
|
142
|
-
}
|
|
132
|
+
};
|
|
133
|
+
const sharedConfig = await bundlerOverride(baseConfig, { bundler: 'webpack' });
|
|
134
|
+
const conf = await webpackOverride(sharedConfig);
|
|
143
135
|
return (0, shared_bundler_config_1.computeHashAndFinalConfig)(conf, {
|
|
144
136
|
enableCaching,
|
|
145
137
|
environment,
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"url": "https://github.com/remotion-dev/remotion/tree/main/packages/bundler"
|
|
4
4
|
},
|
|
5
5
|
"name": "@remotion/bundler",
|
|
6
|
-
"version": "4.0.
|
|
6
|
+
"version": "4.0.498",
|
|
7
7
|
"description": "Bundle Remotion compositions using Webpack",
|
|
8
8
|
"main": "dist/index.js",
|
|
9
9
|
"bugs": {
|
|
@@ -24,11 +24,11 @@
|
|
|
24
24
|
"css-loader": "7.1.4",
|
|
25
25
|
"esbuild": "0.28.1",
|
|
26
26
|
"react-refresh": "0.18.0",
|
|
27
|
-
"remotion": "4.0.
|
|
28
|
-
"@remotion/studio": "4.0.
|
|
29
|
-
"@remotion/studio-shared": "4.0.
|
|
30
|
-
"@remotion/timeline-utils": "4.0.
|
|
31
|
-
"@remotion/media-parser": "4.0.
|
|
27
|
+
"remotion": "4.0.498",
|
|
28
|
+
"@remotion/studio": "4.0.498",
|
|
29
|
+
"@remotion/studio-shared": "4.0.498",
|
|
30
|
+
"@remotion/timeline-utils": "4.0.498",
|
|
31
|
+
"@remotion/media-parser": "4.0.498",
|
|
32
32
|
"style-loader": "4.0.0",
|
|
33
33
|
"webpack": "5.105.0"
|
|
34
34
|
},
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"devDependencies": {
|
|
40
40
|
"react": "19.2.3",
|
|
41
41
|
"react-dom": "19.2.3",
|
|
42
|
-
"@remotion/eslint-config-internal": "4.0.
|
|
42
|
+
"@remotion/eslint-config-internal": "4.0.498",
|
|
43
43
|
"eslint": "9.19.0",
|
|
44
44
|
"@typescript/native-preview": "7.0.0-dev.20260217.1"
|
|
45
45
|
},
|