@microsoft/loader-load-themed-styles 2.1.125 → 2.2.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/CHANGELOG.json CHANGED
@@ -1,6 +1,52 @@
1
1
  {
2
2
  "name": "@microsoft/loader-load-themed-styles",
3
3
  "entries": [
4
+ {
5
+ "version": "2.2.1",
6
+ "tag": "@microsoft/loader-load-themed-styles_v2.2.1",
7
+ "date": "Fri, 20 Feb 2026 00:15:04 GMT",
8
+ "comments": {
9
+ "patch": [
10
+ {
11
+ "comment": "Add `\"node\"` condition before `\"import\"` in the `\"exports\"` map so that Node.js uses the CJS output (which handles extensionless imports), while bundlers still use ESM via `\"import\"`. Fixes https://github.com/microsoft/rushstack/issues/5644."
12
+ }
13
+ ],
14
+ "dependency": [
15
+ {
16
+ "comment": "Updating dependency \"@microsoft/load-themed-styles\" to `2.2.1`"
17
+ },
18
+ {
19
+ "comment": "Updating dependency \"@rushstack/heft\" to `1.2.1`"
20
+ },
21
+ {
22
+ "comment": "Updating dependency \"@microsoft/load-themed-styles\" from `^2.2.0` to `2.2.1`"
23
+ }
24
+ ]
25
+ }
26
+ },
27
+ {
28
+ "version": "2.2.0",
29
+ "tag": "@microsoft/loader-load-themed-styles_v2.2.0",
30
+ "date": "Thu, 19 Feb 2026 00:04:52 GMT",
31
+ "comments": {
32
+ "minor": [
33
+ {
34
+ "comment": "Normalize package layout. CommonJS is now under `lib-commonjs`, DTS is now under `lib-dts`, and ESM is now under `lib-esm`. Imports to `lib` still work as before, handled by the `\"exports\"` field in `package.json`."
35
+ }
36
+ ],
37
+ "dependency": [
38
+ {
39
+ "comment": "Updating dependency \"@microsoft/load-themed-styles\" to `2.2.0`"
40
+ },
41
+ {
42
+ "comment": "Updating dependency \"@rushstack/heft\" to `1.2.0`"
43
+ },
44
+ {
45
+ "comment": "Updating dependency \"@microsoft/load-themed-styles\" from `^2.1.29` to `2.2.0`"
46
+ }
47
+ ]
48
+ }
49
+ },
4
50
  {
5
51
  "version": "2.1.125",
6
52
  "tag": "@microsoft/loader-load-themed-styles_v2.1.125",
package/CHANGELOG.md CHANGED
@@ -1,6 +1,20 @@
1
1
  # Change Log - @microsoft/loader-load-themed-styles
2
2
 
3
- This log was last generated on Sat, 07 Feb 2026 01:13:26 GMT and should not be manually modified.
3
+ This log was last generated on Fri, 20 Feb 2026 00:15:04 GMT and should not be manually modified.
4
+
5
+ ## 2.2.1
6
+ Fri, 20 Feb 2026 00:15:04 GMT
7
+
8
+ ### Patches
9
+
10
+ - Add `"node"` condition before `"import"` in the `"exports"` map so that Node.js uses the CJS output (which handles extensionless imports), while bundlers still use ESM via `"import"`. Fixes https://github.com/microsoft/rushstack/issues/5644.
11
+
12
+ ## 2.2.0
13
+ Thu, 19 Feb 2026 00:04:52 GMT
14
+
15
+ ### Minor changes
16
+
17
+ - Normalize package layout. CommonJS is now under `lib-commonjs`, DTS is now under `lib-dts`, and ESM is now under `lib-esm`. Imports to `lib` still work as before, handled by the `"exports"` field in `package.json`.
4
18
 
5
19
  ## 2.1.125
6
20
  Sat, 07 Feb 2026 01:13:26 GMT
@@ -5,7 +5,7 @@
5
5
  "toolPackages": [
6
6
  {
7
7
  "packageName": "@microsoft/api-extractor",
8
- "packageVersion": "7.56.2"
8
+ "packageVersion": "7.57.0"
9
9
  }
10
10
  ]
11
11
  }
@@ -0,0 +1,49 @@
1
+ // Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
2
+ // See LICENSE in the project root for license information.
3
+ const loadedThemedStylesPath = require.resolve('@microsoft/load-themed-styles');
4
+ /**
5
+ * This simple loader wraps the loading of CSS in script equivalent to
6
+ * require("load-themed-styles").loadStyles('... css text ...').
7
+ *
8
+ * @public
9
+ */
10
+ export class LoadThemedStylesLoader {
11
+ constructor() {
12
+ throw new Error('Constructing "LoadThemedStylesLoader" is not supported.');
13
+ }
14
+ static set loadedThemedStylesPath(value) {
15
+ LoadThemedStylesLoader._loadedThemedStylesPath = value;
16
+ }
17
+ /**
18
+ * Use this property to override the path to the `@microsoft/load-themed-styles` package.
19
+ */
20
+ static get loadedThemedStylesPath() {
21
+ return LoadThemedStylesLoader._loadedThemedStylesPath;
22
+ }
23
+ /**
24
+ * Reset the path to the `@microsoft/load-themed-styles package` to the default.
25
+ */
26
+ static resetLoadedThemedStylesPath() {
27
+ LoadThemedStylesLoader._loadedThemedStylesPath = loadedThemedStylesPath;
28
+ }
29
+ static pitch(remainingRequest) {
30
+ const options = loaderUtils.getOptions(this) || {};
31
+ if (options.namedExport) {
32
+ throw new Error('The "namedExport" option has been removed.');
33
+ }
34
+ const { async = false } = options;
35
+ return [
36
+ `var content = require(${loaderUtils.stringifyRequest(this, '!!' + remainingRequest)});`,
37
+ `var loader = require(${JSON.stringify(LoadThemedStylesLoader._loadedThemedStylesPath)});`,
38
+ '',
39
+ 'if(typeof content === "string") content = [[module.id, content]];',
40
+ '',
41
+ '// add the styles to the DOM',
42
+ `for (var i = 0; i < content.length; i++) loader.loadStyles(content[i][1], ${async === true});`,
43
+ '',
44
+ 'if(content.locals) module.exports = content.locals;'
45
+ ].join('\n');
46
+ }
47
+ }
48
+ LoadThemedStylesLoader._loadedThemedStylesPath = loadedThemedStylesPath;
49
+ //# sourceMappingURL=LoadThemedStylesLoader.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LoadThemedStylesLoader.js","sourceRoot":"","sources":["../src/LoadThemedStylesLoader.ts"],"names":[],"mappings":"AAAA,4FAA4F;AAC5F,2DAA2D;AAW3D,MAAM,sBAAsB,GAAW,OAAO,CAAC,OAAO,CAAC,+BAA+B,CAAC,CAAC;AAexF;;;;;GAKG;AACH,MAAM,OAAO,sBAAsB;IAGjC;QACE,MAAM,IAAI,KAAK,CAAC,yDAAyD,CAAC,CAAC;IAC7E,CAAC;IAEM,MAAM,KAAK,sBAAsB,CAAC,KAAa;QACpD,sBAAsB,CAAC,uBAAuB,GAAG,KAAK,CAAC;IACzD,CAAC;IAED;;OAEG;IACI,MAAM,KAAK,sBAAsB;QACtC,OAAO,sBAAsB,CAAC,uBAAuB,CAAC;IACxD,CAAC;IAED;;OAEG;IACI,MAAM,CAAC,2BAA2B;QACvC,sBAAsB,CAAC,uBAAuB,GAAG,sBAAsB,CAAC;IAC1E,CAAC;IAEM,MAAM,CAAC,KAAK,CAA6B,gBAAwB;QACtE,MAAM,OAAO,GAAmC,WAAW,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC;QACnF,IAAK,OAAmC,CAAC,WAAW,EAAE,CAAC;YACrD,MAAM,IAAI,KAAK,CAAC,4CAA4C,CAAC,CAAC;QAChE,CAAC;QAED,MAAM,EAAE,KAAK,GAAG,KAAK,EAAE,GAAG,OAAO,CAAC;QAElC,OAAO;YACL,yBAAyB,WAAW,CAAC,gBAAgB,CAAC,IAAI,EAAE,IAAI,GAAG,gBAAgB,CAAC,IAAI;YACxF,wBAAwB,IAAI,CAAC,SAAS,CAAC,sBAAsB,CAAC,uBAAuB,CAAC,IAAI;YAC1F,EAAE;YACF,mEAAmE;YACnE,EAAE;YACF,8BAA8B;YAC9B,6EAA6E,KAAK,KAAK,IAAI,IAAI;YAC/F,EAAE;YACF,qDAAqD;SACtD,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACf,CAAC;;AA3Cc,8CAAuB,GAAW,sBAAsB,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.\n// See LICENSE in the project root for license information.\n\n/**\n * This simple loader wraps the loading of CSS in script equivalent to\n * require(\"load-themed-styles\").loadStyles('... css text ...').\n * @packageDocumentation\n */\n\nimport type { loader } from 'webpack';\nimport loaderUtils = require('loader-utils');\n\nconst loadedThemedStylesPath: string = require.resolve('@microsoft/load-themed-styles');\n\n/**\n * Options for the loader.\n *\n * @public\n */\nexport interface ILoadThemedStylesLoaderOptions {\n /**\n * If this parameter is set to \"true,\" the \"loadAsync\" parameter is set to true in the call to loadStyles.\n * Defaults to false.\n */\n async?: boolean;\n}\n\n/**\n * This simple loader wraps the loading of CSS in script equivalent to\n * require(\"load-themed-styles\").loadStyles('... css text ...').\n *\n * @public\n */\nexport class LoadThemedStylesLoader {\n private static _loadedThemedStylesPath: string = loadedThemedStylesPath;\n\n public constructor() {\n throw new Error('Constructing \"LoadThemedStylesLoader\" is not supported.');\n }\n\n public static set loadedThemedStylesPath(value: string) {\n LoadThemedStylesLoader._loadedThemedStylesPath = value;\n }\n\n /**\n * Use this property to override the path to the `@microsoft/load-themed-styles` package.\n */\n public static get loadedThemedStylesPath(): string {\n return LoadThemedStylesLoader._loadedThemedStylesPath;\n }\n\n /**\n * Reset the path to the `@microsoft/load-themed-styles package` to the default.\n */\n public static resetLoadedThemedStylesPath(): void {\n LoadThemedStylesLoader._loadedThemedStylesPath = loadedThemedStylesPath;\n }\n\n public static pitch(this: loader.LoaderContext, remainingRequest: string): string {\n const options: ILoadThemedStylesLoaderOptions = loaderUtils.getOptions(this) || {};\n if ((options as Record<string, unknown>).namedExport) {\n throw new Error('The \"namedExport\" option has been removed.');\n }\n\n const { async = false } = options;\n\n return [\n `var content = require(${loaderUtils.stringifyRequest(this, '!!' + remainingRequest)});`,\n `var loader = require(${JSON.stringify(LoadThemedStylesLoader._loadedThemedStylesPath)});`,\n '',\n 'if(typeof content === \"string\") content = [[module.id, content]];',\n '',\n '// add the styles to the DOM',\n `for (var i = 0; i < content.length; i++) loader.loadStyles(content[i][1], ${async === true});`,\n '',\n 'if(content.locals) module.exports = content.locals;'\n ].join('\\n');\n }\n}\n"]}
@@ -0,0 +1,4 @@
1
+ // Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
2
+ // See LICENSE in the project root for license information.
3
+ import { LoadThemedStylesLoader } from './LoadThemedStylesLoader';
4
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,4FAA4F;AAC5F,2DAA2D;AAE3D,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.\n// See LICENSE in the project root for license information.\n\nimport { LoadThemedStylesLoader } from './LoadThemedStylesLoader';\n\nexport = LoadThemedStylesLoader;\n"]}
package/package.json CHANGED
@@ -1,9 +1,32 @@
1
1
  {
2
2
  "name": "@microsoft/loader-load-themed-styles",
3
- "version": "2.1.125",
3
+ "version": "2.2.1",
4
4
  "description": "This simple loader wraps the loading of CSS in script equivalent to `require('load-themed-styles').loadStyles( /* css text */ )`. It is designed to be a replacement for style-loader.",
5
- "main": "lib/index.js",
6
- "typings": "lib/index.d.ts",
5
+ "main": "./lib-commonjs/index.js",
6
+ "module": "./lib-esm/index.js",
7
+ "types": "./lib-dts/index.d.ts",
8
+ "exports": {
9
+ ".": {
10
+ "types": "./lib-dts/index.d.ts",
11
+ "node": "./lib-commonjs/index.js",
12
+ "import": "./lib-esm/index.js",
13
+ "require": "./lib-commonjs/index.js"
14
+ },
15
+ "./lib/*": {
16
+ "types": "./lib-dts/*.d.ts",
17
+ "node": "./lib-commonjs/*.js",
18
+ "import": "./lib-esm/*.js",
19
+ "require": "./lib-commonjs/*.js"
20
+ },
21
+ "./package.json": "./package.json"
22
+ },
23
+ "typesVersions": {
24
+ "*": {
25
+ "lib/*": [
26
+ "lib-dts/*"
27
+ ]
28
+ }
29
+ },
7
30
  "license": "MIT",
8
31
  "repository": {
9
32
  "type": "git",
@@ -17,7 +40,7 @@
17
40
  },
18
41
  "peerDependencies": {
19
42
  "@types/webpack": "^4",
20
- "@microsoft/load-themed-styles": "^2.1.29"
43
+ "@microsoft/load-themed-styles": "^2.2.1"
21
44
  },
22
45
  "dependencies": {
23
46
  "loader-utils": "1.4.2"
@@ -26,10 +49,11 @@
26
49
  "@types/loader-utils": "1.1.3",
27
50
  "@types/webpack": "4.41.32",
28
51
  "eslint": "~9.37.0",
29
- "@microsoft/load-themed-styles": "2.1.29",
52
+ "@microsoft/load-themed-styles": "2.2.1",
30
53
  "local-node-rig": "1.0.0",
31
- "@rushstack/heft": "1.1.14"
54
+ "@rushstack/heft": "1.2.1"
32
55
  },
56
+ "sideEffects": false,
33
57
  "scripts": {
34
58
  "build": "heft build --clean",
35
59
  "_phase:build": "heft run --only build -- --clean",
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes