@remotion/bundler 4.0.497 → 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 CHANGED
@@ -1,9 +1,11 @@
1
1
  import type { GitSource, RenderDefaults } from '@remotion/studio-shared';
2
2
  import webpack from 'webpack';
3
- import type { WebpackOverrideFn } from './webpack-config';
3
+ import type { BundlerOverrideFn, RspackOverrideFn, WebpackOverrideFn } from './override-types';
4
4
  export declare const getBundlePublicPath: (publicPath: string | null) => string;
5
5
  export declare const getBundleStaticHash: (publicPath: string) => string;
6
6
  export type MandatoryLegacyBundleOptions = {
7
+ bundlerOverride?: BundlerOverrideFn;
8
+ rspackOverride?: RspackOverrideFn;
7
9
  webpackOverride: WebpackOverrideFn;
8
10
  outDir: string | null;
9
11
  enableCaching: boolean;
@@ -25,12 +27,10 @@ export type MandatoryLegacyBundleOptions = {
25
27
  symlinkPublicDir: boolean;
26
28
  };
27
29
  export type LegacyBundleOptions = Partial<MandatoryLegacyBundleOptions>;
28
- export declare const getConfig: ({ entryPoint, outDir, resolvedRemotionRoot, onProgress, options, bufferStateDelayInMilliseconds, maxTimelineTracks, }: {
30
+ export declare const getConfig: ({ entryPoint, outDir, resolvedRemotionRoot, onProgress, options, }: {
29
31
  outDir: string;
30
32
  entryPoint: string;
31
33
  resolvedRemotionRoot: string;
32
- bufferStateDelayInMilliseconds: number | null;
33
- maxTimelineTracks: number | null;
34
34
  onProgress: (progress: number) => void;
35
35
  options: MandatoryLegacyBundleOptions;
36
36
  }) => Promise<[string, webpack.Configuration]> | Promise<[string, import("@rspack/core").RspackOptions]>;
package/dist/bundle.js CHANGED
@@ -100,25 +100,22 @@ const getBundleStaticHash = (publicPath) => {
100
100
  .join('/'));
101
101
  };
102
102
  exports.getBundleStaticHash = getBundleStaticHash;
103
- const getConfig = ({ entryPoint, outDir, resolvedRemotionRoot, onProgress, options, bufferStateDelayInMilliseconds, maxTimelineTracks, }) => {
104
- var _a, _b, _c, _d, _e;
103
+ const getConfig = ({ entryPoint, outDir, resolvedRemotionRoot, onProgress, options, }) => {
104
+ var _a, _b, _c, _d;
105
105
  const configArgs = {
106
106
  entry: node_path_1.default.join(require.resolve('@remotion/studio/renderEntry'), '..', 'esm', 'renderEntry.mjs'),
107
107
  userDefinedComponent: entryPoint,
108
108
  outDir,
109
109
  environment: 'production',
110
- webpackOverride: (_a = options === null || options === void 0 ? void 0 : options.webpackOverride) !== null && _a !== void 0 ? _a : ((f) => f),
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),
111
113
  onProgress: (p) => {
112
114
  onProgress === null || onProgress === void 0 ? void 0 : onProgress(p);
113
115
  },
114
- enableCaching: (_b = options === null || options === void 0 ? void 0 : options.enableCaching) !== null && _b !== void 0 ? _b : true,
115
- maxTimelineTracks,
116
+ enableCaching: (_d = options === null || options === void 0 ? void 0 : options.enableCaching) !== null && _d !== void 0 ? _d : true,
116
117
  remotionRoot: resolvedRemotionRoot,
117
- keyboardShortcutsEnabled: (_c = options === null || options === void 0 ? void 0 : options.keyboardShortcutsEnabled) !== null && _c !== void 0 ? _c : true,
118
- bufferStateDelayInMilliseconds,
119
118
  poll: null,
120
- askAIEnabled: (_d = options === null || options === void 0 ? void 0 : options.askAIEnabled) !== null && _d !== void 0 ? _d : true,
121
- interactivityEnabled: (_e = options === null || options === void 0 ? void 0 : options.interactivityEnabled) !== null && _e !== void 0 ? _e : true,
122
119
  extraPlugins: [],
123
120
  };
124
121
  if (options.rspack) {
@@ -175,7 +172,7 @@ const validateEntryPoint = async (entryPoint) => {
175
172
  };
176
173
  const internalBundle = async (actualArgs) => {
177
174
  var _a, _b;
178
- var _c, _d, _e, _f, _g, _h, _j, _k, _l;
175
+ var _c, _d, _e, _f, _g, _h, _j, _k;
179
176
  const entryPoint = node_path_1.default.resolve(process.cwd(), actualArgs.entryPoint);
180
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();
181
178
  if (!actualArgs.ignoreRegisterRootWarning) {
@@ -197,9 +194,6 @@ const internalBundle = async (actualArgs) => {
197
194
  resolvedRemotionRoot,
198
195
  onProgress,
199
196
  options,
200
- // Should be null to keep cache hash working
201
- bufferStateDelayInMilliseconds: (_f = actualArgs.bufferStateDelayInMilliseconds) !== null && _f !== void 0 ? _f : null,
202
- maxTimelineTracks: actualArgs.maxTimelineTracks,
203
197
  });
204
198
  if (actualArgs.rspack) {
205
199
  const { rspack: rspackFn } = require('@rspack/core');
@@ -312,12 +306,12 @@ const internalBundle = async (actualArgs) => {
312
306
  }),
313
307
  includeFavicon: true,
314
308
  title: 'Remotion Bundle',
315
- renderDefaults: (_g = actualArgs.renderDefaults) !== null && _g !== void 0 ? _g : undefined,
309
+ renderDefaults: (_f = actualArgs.renderDefaults) !== null && _f !== void 0 ? _f : undefined,
316
310
  publicFolderExists: `${publicPath + (publicPath.endsWith('/') ? '' : '/')}public`,
317
311
  fileSystemPlatform: null,
318
- gitSource: (_h = actualArgs.gitSource) !== null && _h !== void 0 ? _h : null,
312
+ gitSource: (_g = actualArgs.gitSource) !== null && _g !== void 0 ? _g : null,
319
313
  projectName: (0, studio_shared_1.getProjectName)({
320
- gitSource: (_j = actualArgs.gitSource) !== null && _j !== void 0 ? _j : null,
314
+ gitSource: (_h = actualArgs.gitSource) !== null && _h !== void 0 ? _h : null,
321
315
  resolvedRemotionRoot,
322
316
  basename: node_path_1.default.basename,
323
317
  }),
@@ -326,8 +320,8 @@ const internalBundle = async (actualArgs) => {
326
320
  // Actual log level is set in setPropsAndEnv()
327
321
  logLevel: 'info',
328
322
  mode: 'bundle',
329
- audioLatencyHint: (_k = actualArgs.audioLatencyHint) !== null && _k !== void 0 ? _k : 'playback',
330
- sampleRate: (_l = (_b = actualArgs.renderDefaults) === null || _b === void 0 ? void 0 : _b.sampleRate) !== null && _l !== void 0 ? _l : 48000,
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,
331
325
  studioRuntimeConfig: {
332
326
  askAIEnabled: actualArgs.askAIEnabled,
333
327
  bufferStateDelayInMilliseconds: actualArgs.bufferStateDelayInMilliseconds,
@@ -342,11 +336,11 @@ const internalBundle = async (actualArgs) => {
342
336
  };
343
337
  exports.internalBundle = internalBundle;
344
338
  /*
345
- * @description Bundles a Remotion project using Webpack and prepares it for rendering.
339
+ * @description Bundles a Remotion project and prepares it for rendering.
346
340
  * @see [Documentation](https://remotion.dev/docs/bundle)
347
341
  */
348
342
  async function bundle(...args) {
349
- 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;
350
344
  const actualArgs = convertArgumentsIntoOptions(args);
351
345
  const result = await (0, exports.internalBundle)({
352
346
  bufferStateDelayInMilliseconds: (_a = actualArgs.bufferStateDelayInMilliseconds) !== null && _a !== void 0 ? _a : null,
@@ -363,14 +357,16 @@ async function bundle(...args) {
363
357
  publicDir: (_l = actualArgs.publicDir) !== null && _l !== void 0 ? _l : null,
364
358
  publicPath: (_m = actualArgs.publicPath) !== null && _m !== void 0 ? _m : null,
365
359
  rootDir: (_o = actualArgs.rootDir) !== null && _o !== void 0 ? _o : null,
366
- webpackOverride: (_p = actualArgs.webpackOverride) !== null && _p !== void 0 ? _p : ((f) => f),
367
- audioLatencyHint: (_q = actualArgs.audioLatencyHint) !== null && _q !== void 0 ? _q : null,
368
- renderDefaults: (_r = actualArgs.renderDefaults) !== null && _r !== void 0 ? _r : null,
369
- askAIEnabled: (_s = actualArgs.askAIEnabled) !== null && _s !== void 0 ? _s : true,
370
- interactivityEnabled: (_t = actualArgs.interactivityEnabled) !== null && _t !== void 0 ? _t : true,
371
- keyboardShortcutsEnabled: (_u = actualArgs.keyboardShortcutsEnabled) !== null && _u !== void 0 ? _u : true,
372
- rspack: (_v = actualArgs.rspack) !== null && _v !== void 0 ? _v : false,
373
- symlinkPublicDir: (_w = actualArgs.symlinkPublicDir) !== null && _w !== void 0 ? _w : false,
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,
374
370
  });
375
371
  return result;
376
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, maxTimelineTracks, remotionRoot, keyboardShortcutsEnabled, bufferStateDelayInMilliseconds, poll, askAIEnabled, interactivityEnabled, extraPlugins, }: {
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
- webpackOverride: import("./webpack-config").WebpackOverrideFn;
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, webpackOverride, onProgress, enableCaching, maxTimelineTracks, remotionRoot, keyboardShortcutsEnabled, bufferStateDelayInMilliseconds, poll, askAIEnabled, interactivityEnabled, extraPlugins, }: {
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
- webpackOverride: import("./webpack-config").WebpackOverrideFn;
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, bufferStateDelayInMilliseconds, maxTimelineTracks, }: {
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 './webpack-config';
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>;
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,21 +1,16 @@
1
- import type { Configuration } from '@rspack/core';
2
- import type { WebpackOverrideFn } from './webpack-config';
3
- export type RspackConfiguration = Configuration;
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
- webpackOverride: WebpackOverrideFn;
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;
@@ -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, webpackOverride = (f) => f, onProgress, enableCaching = true, maxTimelineTracks, remotionRoot, keyboardShortcutsEnabled, bufferStateDelayInMilliseconds, poll, askAIEnabled, interactivityEnabled, extraPlugins, }) => {
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
- // Rspack config is structurally compatible with webpack config at runtime,
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
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
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,
@@ -1,21 +1,16 @@
1
- import type { Configuration } from 'webpack';
2
1
  import webpack from 'webpack';
3
- export type WebpackConfiguration = Configuration;
4
- export type WebpackOverrideFn = (currentConfiguration: WebpackConfiguration) => WebpackConfiguration | Promise<WebpackConfiguration>;
5
- export declare const webpackConfig: ({ entry, userDefinedComponent, outDir, environment, webpackOverride, onProgress, enableCaching, maxTimelineTracks, remotionRoot, keyboardShortcutsEnabled, bufferStateDelayInMilliseconds, poll, askAIEnabled, interactivityEnabled, extraPlugins, }: {
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]>;
@@ -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, maxTimelineTracks, remotionRoot, keyboardShortcutsEnabled, bufferStateDelayInMilliseconds, poll, askAIEnabled, interactivityEnabled, extraPlugins, }) => {
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 define = new webpack_1.default.DefinePlugin((0, define_plugin_definitions_1.getDefinePluginDefinitions)({
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.497",
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.497",
28
- "@remotion/studio": "4.0.497",
29
- "@remotion/studio-shared": "4.0.497",
30
- "@remotion/timeline-utils": "4.0.497",
31
- "@remotion/media-parser": "4.0.497",
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.497",
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
  },