@rsbuild/plugin-svgr 1.0.0 → 1.0.1-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/README.md CHANGED
@@ -4,7 +4,7 @@
4
4
 
5
5
  # Rsbuild
6
6
 
7
- Unleash the power of Rspack with the out-of-the-box build tool.
7
+ The Rspack-based build tool. It's fast, out-of-the-box and extensible.
8
8
 
9
9
  ## Documentation
10
10
 
@@ -0,0 +1 @@
1
+ export = any;
@@ -0,0 +1,147 @@
1
+ (() => {
2
+ "use strict";
3
+ var __webpack_modules__ = {
4
+ 601: (module, __unused_webpack_exports, __nccwpck_require__) => {
5
+ const loader = __nccwpck_require__(532);
6
+ module.exports = loader.default;
7
+ module.exports.raw = loader.raw;
8
+ },
9
+ 532: (__unused_webpack_module, exports, __nccwpck_require__) => {
10
+ Object.defineProperty(exports, "__esModule", { value: true });
11
+ exports["default"] = loader;
12
+ exports.raw = void 0;
13
+ var _path = _interopRequireDefault(__nccwpck_require__(17));
14
+ var _loaderUtils = __nccwpck_require__(429);
15
+ var _schemaUtils = __nccwpck_require__(14);
16
+ var _options = _interopRequireDefault(__nccwpck_require__(719));
17
+ var _utils = __nccwpck_require__(913);
18
+ function _interopRequireDefault(obj) {
19
+ return obj && obj.__esModule ? obj : { default: obj };
20
+ }
21
+ function loader(content) {
22
+ const options = (0, _loaderUtils.getOptions)(this);
23
+ (0, _schemaUtils.validate)(_options.default, options, {
24
+ name: "File Loader",
25
+ baseDataPath: "options",
26
+ });
27
+ const context = options.context || this.rootContext;
28
+ const name = options.name || "[contenthash].[ext]";
29
+ const url = (0, _loaderUtils.interpolateName)(this, name, {
30
+ context,
31
+ content,
32
+ regExp: options.regExp,
33
+ });
34
+ let outputPath = url;
35
+ if (options.outputPath) {
36
+ if (typeof options.outputPath === "function") {
37
+ outputPath = options.outputPath(url, this.resourcePath, context);
38
+ } else {
39
+ outputPath = _path.default.posix.join(options.outputPath, url);
40
+ }
41
+ }
42
+ let publicPath = `__webpack_public_path__ + ${JSON.stringify(outputPath)}`;
43
+ if (options.publicPath) {
44
+ if (typeof options.publicPath === "function") {
45
+ publicPath = options.publicPath(url, this.resourcePath, context);
46
+ } else {
47
+ publicPath = `${options.publicPath.endsWith("/") ? options.publicPath : `${options.publicPath}/`}${url}`;
48
+ }
49
+ publicPath = JSON.stringify(publicPath);
50
+ }
51
+ if (options.postTransformPublicPath) {
52
+ publicPath = options.postTransformPublicPath(publicPath);
53
+ }
54
+ if (typeof options.emitFile === "undefined" || options.emitFile) {
55
+ const assetInfo = {};
56
+ if (typeof name === "string") {
57
+ let normalizedName = name;
58
+ const idx = normalizedName.indexOf("?");
59
+ if (idx >= 0) {
60
+ normalizedName = normalizedName.substr(0, idx);
61
+ }
62
+ const isImmutable =
63
+ /\[([^:\]]+:)?(hash|contenthash)(:[^\]]+)?]/gi.test(
64
+ normalizedName,
65
+ );
66
+ if (isImmutable === true) {
67
+ assetInfo.immutable = true;
68
+ }
69
+ }
70
+ assetInfo.sourceFilename = (0, _utils.normalizePath)(
71
+ _path.default.relative(this.rootContext, this.resourcePath),
72
+ );
73
+ this.emitFile(outputPath, content, null, assetInfo);
74
+ }
75
+ const esModule =
76
+ typeof options.esModule !== "undefined" ? options.esModule : true;
77
+ return `${esModule ? "export default" : "module.exports ="} ${publicPath};`;
78
+ }
79
+ const raw = true;
80
+ exports.raw = raw;
81
+ },
82
+ 913: (__unused_webpack_module, exports) => {
83
+ Object.defineProperty(exports, "__esModule", { value: true });
84
+ exports.normalizePath = normalizePath;
85
+ function normalizePath(path, stripTrailing) {
86
+ if (path === "\\" || path === "/") {
87
+ return "/";
88
+ }
89
+ const len = path.length;
90
+ if (len <= 1) {
91
+ return path;
92
+ }
93
+ let prefix = "";
94
+ if (len > 4 && path[3] === "\\") {
95
+ const ch = path[2];
96
+ if ((ch === "?" || ch === ".") && path.slice(0, 2) === "\\\\") {
97
+ path = path.slice(2);
98
+ prefix = "//";
99
+ }
100
+ }
101
+ const segs = path.split(/[/\\]+/);
102
+ if (stripTrailing !== false && segs[segs.length - 1] === "") {
103
+ segs.pop();
104
+ }
105
+ return prefix + segs.join("/");
106
+ }
107
+ },
108
+ 14: (module) => {
109
+ module.exports = require("./schema-utils");
110
+ },
111
+ 429: (module) => {
112
+ module.exports = require("loader-utils");
113
+ },
114
+ 17: (module) => {
115
+ module.exports = require("path");
116
+ },
117
+ 719: (module) => {
118
+ module.exports = JSON.parse(
119
+ '{"additionalProperties":true,"properties":{"name":{"description":"The filename template for the target file(s) (https://github.com/webpack-contrib/file-loader#name).","anyOf":[{"type":"string"},{"instanceof":"Function"}]},"outputPath":{"description":"A filesystem path where the target file(s) will be placed (https://github.com/webpack-contrib/file-loader#outputpath).","anyOf":[{"type":"string"},{"instanceof":"Function"}]},"publicPath":{"description":"A custom public path for the target file(s) (https://github.com/webpack-contrib/file-loader#publicpath).","anyOf":[{"type":"string"},{"instanceof":"Function"}]},"postTransformPublicPath":{"description":"A custom transformation function for post-processing the publicPath (https://github.com/webpack-contrib/file-loader#posttransformpublicpath).","instanceof":"Function"},"context":{"description":"A custom file context (https://github.com/webpack-contrib/file-loader#context).","type":"string"},"emitFile":{"description":"Enables/Disables emit files (https://github.com/webpack-contrib/file-loader#emitfile).","type":"boolean"},"regExp":{"description":"A Regular Expression to one or many parts of the target file path. The capture groups can be reused in the name property using [N] placeholder (https://github.com/webpack-contrib/file-loader#regexp).","anyOf":[{"type":"string"},{"instanceof":"RegExp"}]},"esModule":{"description":"By default, file-loader generates JS modules that use the ES modules syntax.","type":"boolean"}},"type":"object"}',
120
+ );
121
+ },
122
+ };
123
+ var __webpack_module_cache__ = {};
124
+ function __nccwpck_require__(moduleId) {
125
+ var cachedModule = __webpack_module_cache__[moduleId];
126
+ if (cachedModule !== undefined) {
127
+ return cachedModule.exports;
128
+ }
129
+ var module = (__webpack_module_cache__[moduleId] = { exports: {} });
130
+ var threw = true;
131
+ try {
132
+ __webpack_modules__[moduleId](
133
+ module,
134
+ module.exports,
135
+ __nccwpck_require__,
136
+ );
137
+ threw = false;
138
+ } finally {
139
+ if (threw) delete __webpack_module_cache__[moduleId];
140
+ }
141
+ return module.exports;
142
+ }
143
+ if (typeof __nccwpck_require__ !== "undefined")
144
+ __nccwpck_require__.ab = __dirname + "/";
145
+ var __webpack_exports__ = __nccwpck_require__(601);
146
+ module.exports = __webpack_exports__;
147
+ })();
@@ -0,0 +1,20 @@
1
+ Copyright JS Foundation and other contributors
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ 'Software'), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
17
+ IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
18
+ CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
19
+ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
20
+ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1 @@
1
+ {"name":"file-loader","author":"Tobias Koppers @sokra","version":"6.2.0","funding":{"type":"opencollective","url":"https://opencollective.com/webpack"},"license":"MIT","types":"index.d.ts","type":"commonjs"}
@@ -0,0 +1 @@
1
+ module.exports.validate = () => {};
@@ -0,0 +1 @@
1
+ export = any;