webpack 4.45.0 → 4.46.0

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.
@@ -683,6 +683,10 @@ export interface ResolveOptions {
683
683
  fileSystem?: {
684
684
  [k: string]: any;
685
685
  };
686
+ /**
687
+ * Enable to ignore fatal errors happening during resolving of 'resolve.roots'. Usually such errors should not happen, but this option is provided for backward-compatibility.
688
+ */
689
+ ignoreRootsErrors?: boolean;
686
690
  /**
687
691
  * Field names from the description file (package.json) which are used to find the default entry point
688
692
  */
@@ -703,6 +707,10 @@ export interface ResolveOptions {
703
707
  * Plugins for the resolver
704
708
  */
705
709
  plugins?: (WebpackPluginInstance | WebpackPluginFunction)[];
710
+ /**
711
+ * Prefer to resolve server-relative URLs (starting with '/') as absolute paths before falling back to resolve in 'resolve.roots'.
712
+ */
713
+ preferAbsolute?: boolean;
706
714
  /**
707
715
  * Custom resolver
708
716
  */
@@ -710,7 +718,7 @@ export interface ResolveOptions {
710
718
  [k: string]: any;
711
719
  };
712
720
  /**
713
- * A list of directories in which requests that are server-relative URLs (starting with '/') are resolved. On non-windows system these requests are tried to resolve as absolute path first.
721
+ * A list of directories in which requests that are server-relative URLs (starting with '/') are resolved.
714
722
  */
715
723
  roots?: string[];
716
724
  /**
@@ -356,6 +356,16 @@ class WebpackOptionsDefaulter extends OptionsDefaulter {
356
356
  options.resolve.plugins.length > 0
357
357
  );
358
358
  });
359
+ this.set(
360
+ "resolve.preferAbsolute",
361
+ "make",
362
+ options => !options.resolve.roots || options.resolve.roots.length === 0
363
+ );
364
+ this.set(
365
+ "resolve.ignoreRootsErrors",
366
+ "make",
367
+ options => !options.resolve.roots || options.resolve.roots.length === 0
368
+ );
359
369
  this.set("resolve.roots", "make", options => [options.context]);
360
370
 
361
371
  this.set("resolveLoader", "call", value => Object.assign({}, value));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "webpack",
3
- "version": "4.45.0",
3
+ "version": "4.46.0",
4
4
  "author": "Tobias Koppers @sokra",
5
5
  "description": "Packs CommonJs/AMD modules for the browser. Allows to split your codebase into multiple bundles, which can be loaded on demand. Support loaders to preprocess files, i.e. json, jsx, es7, css, less, ... and your custom stuff.",
6
6
  "license": "MIT",
@@ -13,7 +13,7 @@
13
13
  "ajv": "^6.10.2",
14
14
  "ajv-keywords": "^3.4.1",
15
15
  "chrome-trace-event": "^1.0.2",
16
- "enhanced-resolve": "^4.3.0",
16
+ "enhanced-resolve": "^4.5.0",
17
17
  "eslint-scope": "^4.0.3",
18
18
  "json-parse-better-errors": "^1.0.2",
19
19
  "loader-runner": "^2.4.0",
@@ -1179,6 +1179,10 @@
1179
1179
  "fileSystem": {
1180
1180
  "description": "Filesystem for the resolver"
1181
1181
  },
1182
+ "ignoreRootsErrors": {
1183
+ "description": "Enable to ignore fatal errors happening during resolving of 'resolve.roots'. Usually such errors should not happen, but this option is provided for backward-compatibility.",
1184
+ "type": "boolean"
1185
+ },
1182
1186
  "mainFields": {
1183
1187
  "description": "Field names from the description file (package.json) which are used to find the default entry point",
1184
1188
  "anyOf": [
@@ -1226,11 +1230,15 @@
1226
1230
  ]
1227
1231
  }
1228
1232
  },
1233
+ "preferAbsolute": {
1234
+ "description": "Prefer to resolve server-relative URLs (starting with '/') as absolute paths before falling back to resolve in 'resolve.roots'.",
1235
+ "type": "boolean"
1236
+ },
1229
1237
  "resolver": {
1230
1238
  "description": "Custom resolver"
1231
1239
  },
1232
1240
  "roots": {
1233
- "description": "A list of directories in which requests that are server-relative URLs (starting with '/') are resolved. On non-windows system these requests are tried to resolve as absolute path first.",
1241
+ "description": "A list of directories in which requests that are server-relative URLs (starting with '/') are resolved.",
1234
1242
  "type": "array",
1235
1243
  "items": {
1236
1244
  "description": "Directory in which requests that are server-relative URLs (starting with '/') are resolved.",