@nx/webpack 17.3.1 → 18.0.0-beta.1

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nx/webpack",
3
- "version": "17.3.1",
3
+ "version": "18.0.0-beta.1",
4
4
  "private": false,
5
5
  "description": "The Nx Plugin for Webpack contains executors and generators that support building applications using Webpack.",
6
6
  "repository": {
@@ -62,9 +62,9 @@
62
62
  "webpack-dev-server": "^4.9.3",
63
63
  "webpack-node-externals": "^3.0.0",
64
64
  "webpack-subresource-integrity": "^5.1.0",
65
- "@nx/devkit": "17.3.1",
66
- "@nx/js": "17.3.1",
67
- "@nrwl/webpack": "17.3.1"
65
+ "@nx/devkit": "18.0.0-beta.1",
66
+ "@nx/js": "18.0.0-beta.1",
67
+ "@nrwl/webpack": "18.0.0-beta.1"
68
68
  },
69
69
  "publishConfig": {
70
70
  "access": "public"
@@ -4,18 +4,23 @@ exports.getRootTsConfigPath = exports.readTsConfig = exports.readTsPathMappings
4
4
  const fs_1 = require("fs");
5
5
  const path_1 = require("path");
6
6
  const devkit_1 = require("@nx/devkit");
7
- let tsConfig;
8
- let tsPathMappings;
7
+ let tsConfig = new Map();
8
+ let tsPathMappings = new Map();
9
9
  function readTsPathMappings(tsConfigPath = process.env.NX_TSCONFIG_PATH ?? getRootTsConfigPath()) {
10
- if (tsPathMappings) {
11
- return tsPathMappings;
10
+ if (tsPathMappings.has(tsConfigPath)) {
11
+ return tsPathMappings.get(tsConfigPath);
12
12
  }
13
- tsConfig ??= readTsConfiguration(tsConfigPath);
14
- tsPathMappings = {};
15
- Object.entries(tsConfig.options?.paths ?? {}).forEach(([alias, paths]) => {
16
- tsPathMappings[alias] = paths.map((path) => path.replace(/^\.\//, ''));
13
+ if (!tsConfig.has(tsConfigPath)) {
14
+ tsConfig.set(tsConfigPath, readTsConfiguration(tsConfigPath));
15
+ }
16
+ tsPathMappings.set(tsConfigPath, {});
17
+ Object.entries(tsConfig.get(tsConfigPath).options?.paths ?? {}).forEach(([alias, paths]) => {
18
+ tsPathMappings.set(tsConfigPath, {
19
+ ...tsPathMappings.get(tsConfigPath),
20
+ [alias]: paths.map((path) => path.replace(/^\.\//, '')),
21
+ });
17
22
  });
18
- return tsPathMappings;
23
+ return tsPathMappings.get(tsConfigPath);
19
24
  }
20
25
  exports.readTsPathMappings = readTsPathMappings;
21
26
  function readTsConfiguration(tsConfigPath) {
@@ -122,7 +122,7 @@ function PostcssCliResources(options) {
122
122
  const resourceCache = new Map();
123
123
  return Promise.all(urlDeclarations.map(async (decl) => {
124
124
  const value = decl.value;
125
- const urlRegex = /url\(\s*(?:"([^"]+)"|'([^']+)'|(.+?))\s*\)/g;
125
+ const urlRegex = /url(?:\(\s*['"]?)(.*?)(?:['"]?\s*\))/g;
126
126
  const segments = [];
127
127
  let match;
128
128
  let lastIndex = 0;
@@ -131,7 +131,7 @@ function PostcssCliResources(options) {
131
131
  const inputFile = decl.source && decl.source.input.file;
132
132
  const context = (inputFile && path.dirname(inputFile)) || loader.context;
133
133
  while ((match = urlRegex.exec(value))) {
134
- const originalUrl = match[1] || match[2] || match[3];
134
+ const originalUrl = match[1];
135
135
  let processedUrl;
136
136
  try {
137
137
  processedUrl = await process(originalUrl, context, resourceCache);