@microsoft/loader-load-themed-styles 2.1.2 → 2.1.4
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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LoadThemedStylesLoader.d.ts","sourceRoot":"","sources":["../src/LoadThemedStylesLoader.ts"],"names":[],"mappings":"AAGA;;;;GAIG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"LoadThemedStylesLoader.d.ts","sourceRoot":"","sources":["../src/LoadThemedStylesLoader.ts"],"names":[],"mappings":"AAGA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAKtC;;;;GAIG;AACH,MAAM,WAAW,8BAA8B;IAC7C;;;OAGG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAED;;;;;GAKG;AACH,qBAAa,sBAAsB;IACjC,OAAO,CAAC,MAAM,CAAC,uBAAuB,CAAkC;;IAMxE,WAAkB,sBAAsB,CAAC,KAAK,EAAE,MAAM,EAErD;IAED;;OAEG;IACH,WAAkB,sBAAsB,IAAI,MAAM,CAEjD;IAED;;OAEG;WACW,2BAA2B,IAAI,IAAI;WAInC,KAAK,CAAC,IAAI,EAAE,MAAM,CAAC,aAAa,EAAE,gBAAgB,EAAE,MAAM,GAAG,MAAM;CAoBlF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LoadThemedStylesLoader.js","sourceRoot":"","sources":["../src/LoadThemedStylesLoader.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,2DAA2D;;;AAS3D,4CAA6C;AAE7C,MAAM,sBAAsB,GAAW,OAAO,CAAC,OAAO,CAAC,+BAA+B,CAAC,CAAC;AAexF;;;;;GAKG;AACH,MAAa,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;YACpD,MAAM,IAAI,KAAK,CAAC,4CAA4C,CAAC,CAAC;SAC/D;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;AAD7D,wDAAsB","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 { 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"]}
|
|
1
|
+
{"version":3,"file":"LoadThemedStylesLoader.js","sourceRoot":"","sources":["../src/LoadThemedStylesLoader.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,2DAA2D;;;AAS3D,4CAA6C;AAE7C,MAAM,sBAAsB,GAAW,OAAO,CAAC,OAAO,CAAC,+BAA+B,CAAC,CAAC;AAexF;;;;;GAKG;AACH,MAAa,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;YACpD,MAAM,IAAI,KAAK,CAAC,4CAA4C,CAAC,CAAC;SAC/D;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;AAD7D,wDAAsB","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"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@microsoft/loader-load-themed-styles",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.4",
|
|
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
5
|
"main": "lib/index.js",
|
|
6
6
|
"typings": "lib/index.d.ts",
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
},
|
|
18
18
|
"peerDependencies": {
|
|
19
19
|
"@types/webpack": "^4",
|
|
20
|
-
"@microsoft/load-themed-styles": "^2.0.
|
|
20
|
+
"@microsoft/load-themed-styles": "^2.0.80"
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
23
|
"loader-utils": "1.4.2"
|
|
@@ -25,10 +25,9 @@
|
|
|
25
25
|
"devDependencies": {
|
|
26
26
|
"@types/loader-utils": "1.1.3",
|
|
27
27
|
"@types/webpack": "4.41.32",
|
|
28
|
-
"@microsoft/load-themed-styles": "2.0.
|
|
29
|
-
"@rushstack/eslint-config": "3.3.4",
|
|
28
|
+
"@microsoft/load-themed-styles": "2.0.80",
|
|
30
29
|
"local-node-rig": "1.0.0",
|
|
31
|
-
"@rushstack/heft": "0.61.
|
|
30
|
+
"@rushstack/heft": "0.61.2"
|
|
32
31
|
},
|
|
33
32
|
"scripts": {
|
|
34
33
|
"build": "heft build --clean",
|