@remotion/bundler 4.0.95 → 4.0.97

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.
@@ -1,7 +1,5 @@
1
1
  import type { Compiler } from 'webpack';
2
- import type { webpack } from '.';
3
2
  export declare class AllowOptionalDependenciesPlugin {
4
- checkIgnore: (resolveData: webpack.ResolveData) => false | undefined;
5
3
  filter(error: Error): boolean;
6
4
  apply(compiler: Compiler): void;
7
5
  }
@@ -10,17 +10,6 @@ const OPTIONAL_DEPENDENCIES = [
10
10
  ];
11
11
  const SOURCE_MAP_IGNORE = ['path', 'fs'];
12
12
  class AllowOptionalDependenciesPlugin {
13
- constructor() {
14
- this.checkIgnore = (resolveData) => {
15
- if (OPTIONAL_DEPENDENCIES.includes(resolveData.request)) {
16
- return false;
17
- }
18
- if (resolveData.context.includes('source-map') &&
19
- SOURCE_MAP_IGNORE.includes(resolveData.request)) {
20
- return false;
21
- }
22
- };
23
- }
24
13
  filter(error) {
25
14
  for (const dependency of OPTIONAL_DEPENDENCIES) {
26
15
  if (error.message.includes(`Can't resolve '${dependency}'`)) {
@@ -36,16 +25,13 @@ class AllowOptionalDependenciesPlugin {
36
25
  return true;
37
26
  }
38
27
  apply(compiler) {
28
+ compiler.hooks.afterCompile.tap('Com', (compilation) => {
29
+ compilation.errors = compilation.errors.filter(this.filter);
30
+ });
39
31
  compiler.hooks.afterEmit.tap('AllowOptionalDependenciesPlugin', (compilation) => {
40
32
  compilation.errors = compilation.errors.filter(this.filter);
41
33
  compilation.warnings = compilation.warnings.filter(this.filter);
42
34
  });
43
- compiler.hooks.normalModuleFactory.tap('AllowOptionalDependenciesPlugin', (nmf) => {
44
- nmf.hooks.beforeResolve.tap('AllowOptionalDependenciesPlugin', this.checkIgnore);
45
- });
46
- compiler.hooks.contextModuleFactory.tap('AllowOptionalDependenciesPlugin', (cmf) => {
47
- cmf.hooks.beforeResolve.tap('AllowOptionalDependenciesPlugin', this.checkIgnore);
48
- });
49
35
  }
50
36
  }
51
37
  exports.AllowOptionalDependenciesPlugin = AllowOptionalDependenciesPlugin;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@remotion/bundler",
3
- "version": "4.0.95",
3
+ "version": "4.0.97",
4
4
  "description": "Bundler for Remotion",
5
5
  "main": "dist/index.js",
6
6
  "sideEffects": false,
@@ -23,10 +23,11 @@
23
23
  "esbuild": "0.18.6",
24
24
  "react-refresh": "0.9.0",
25
25
  "style-loader": "2.0.0",
26
+ "source-map": "0.7.3",
26
27
  "webpack": "5.83.1",
27
- "remotion": "4.0.95",
28
- "@remotion/studio-shared": "4.0.95",
29
- "@remotion/studio": "4.0.95"
28
+ "remotion": "4.0.97",
29
+ "@remotion/studio": "4.0.97",
30
+ "@remotion/studio-shared": "4.0.97"
30
31
  },
31
32
  "peerDependencies": {
32
33
  "react": ">=16.8.0",
@@ -45,7 +46,6 @@
45
46
  "prettier": "3.1.1",
46
47
  "prettier-plugin-organize-imports": "3.2.4",
47
48
  "react": "18.2.0",
48
- "source-map": "0.7.3",
49
49
  "react-dom": "18.2.0",
50
50
  "vitest": "0.31.1"
51
51
  },