Skip to content

Commit 67b4f08

Browse files
committed
feat: add redirect.asset and update svgr test console.log
1 parent 17fee18 commit 67b4f08

File tree

8 files changed

+75
-98
lines changed

8 files changed

+75
-98
lines changed

packages/core/src/config.ts

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import {
1818
DEFAULT_CONFIG_EXTENSIONS,
1919
DEFAULT_CONFIG_NAME,
2020
DTS_EXTENSIONS_PATTERN,
21+
JS_EXTENSIONS_PATTERN,
2122
RSLIB_ENTRY_QUERY,
2223
SWC_HELPERS,
2324
} from './constant';
@@ -1060,6 +1061,7 @@ const composeBundlelessExternalConfig = (
10601061
const styleRedirectExtension = redirect.style?.extension ?? true;
10611062
const jsRedirectPath = redirect.js?.path ?? true;
10621063
const jsRedirectExtension = redirect.js?.extension ?? true;
1064+
const assetRedirect = redirect.asset ?? true;
10631065

10641066
let resolver: RspackResolver | undefined;
10651067

@@ -1154,15 +1156,26 @@ const composeBundlelessExternalConfig = (
11541156
// If data.request already have an extension, we replace it with new extension
11551157
// This may result in a change in semantics,
11561158
// user should use copy to keep origin file or use another separate entry to deal this
1157-
if (jsRedirectExtension && resolvedRequest.startsWith('.')) {
1159+
if (resolvedRequest.startsWith('.')) {
11581160
const ext = extname(resolvedRequest);
11591161
if (ext) {
11601162
// 1. js files hit JS_EXTENSIONS_PATTERN, ./foo.ts -> ./foo.mjs
1161-
// 2. asset files, does not match jsExtensionsPattern, eg: ./foo.png -> ./foo.mjs
1162-
resolvedRequest = resolvedRequest.replace(
1163-
/\.[^.]+$/,
1164-
jsExtension,
1165-
);
1163+
if (JS_EXTENSIONS_PATTERN.test(resolvedRequest)) {
1164+
if (jsRedirectExtension) {
1165+
resolvedRequest = resolvedRequest.replace(
1166+
/\.[^.]+$/,
1167+
jsExtension,
1168+
);
1169+
}
1170+
} else {
1171+
// 2. asset files, does not match jsExtensionsPattern, eg: ./foo.png -> ./foo.mjs
1172+
if (assetRedirect) {
1173+
resolvedRequest = resolvedRequest.replace(
1174+
/\.[^.]+$/,
1175+
jsExtension,
1176+
);
1177+
}
1178+
}
11661179
} else {
11671180
resolvedRequest = `${resolvedRequest}${jsExtension}`;
11681181
}

packages/core/src/types/config.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -188,8 +188,8 @@ export type Redirect = {
188188
js?: JsRedirect;
189189
/** Controls the redirect of the import paths of output style files. */
190190
style?: StyleRedirect;
191-
// TODO: support other redirects
192-
// asset?: boolean;
191+
/** Controls the redirect of the import paths of output asset files. */
192+
asset?: boolean;
193193
// dts?: DtsRedirect;
194194
};
195195

tests/integration/asset/__snapshots__/index.test.ts.snap

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ const SvgLogo = (props)=>/*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_r
3939
})
4040
});
4141
const logoreact = SvgLogo;
42-
console.log(logoreact);
42+
console.log('queryImport', 'ReactComponent', logoreact);
4343
const logo_SvgLogo = (props)=>/*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)("svg", {
4444
xmlns: "http://www.w3.org/2000/svg",
4545
viewBox: "0 0 841.9 595.3",
@@ -62,8 +62,8 @@ const logo_SvgLogo = (props)=>/*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_
6262
})
6363
});
6464
const logo = __rslib_svgr_url__0__;
65-
console.log(logo_SvgLogo);
66-
console.log(logo);
65+
console.log('namedImport', 'ReactComponent', logo_SvgLogo);
66+
console.log('default Import', 'reexport', logo);
6767
"
6868
`;
6969

@@ -94,7 +94,7 @@ const SvgLogo = (props)=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("svg
9494
})
9595
});
9696
const logoreact = SvgLogo;
97-
console.log(logoreact);
97+
console.log('queryImport', 'ReactComponent', logoreact);
9898
const logo_SvgLogo = (props)=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("svg", {
9999
xmlns: "http://www.w3.org/2000/svg",
100100
viewBox: "0 0 841.9 595.3",
@@ -117,8 +117,8 @@ const logo_SvgLogo = (props)=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)
117117
})
118118
});
119119
const logo = require("./static/svg/logo.svg");
120-
console.log(logo_SvgLogo);
121-
console.log(logo);
120+
console.log('namedImport', 'ReactComponent', logo_SvgLogo);
121+
console.log('default Import', 'reexport', logo);
122122
var __webpack_export_target__ = exports;
123123
for(var __webpack_i__ in __webpack_exports__)__webpack_export_target__[__webpack_i__] = __webpack_exports__[__webpack_i__];
124124
if (__webpack_exports__.__esModule) Object.defineProperty(__webpack_export_target__, '__esModule', {
@@ -129,21 +129,21 @@ if (__webpack_exports__.__esModule) Object.defineProperty(__webpack_export_targe
129129

130130
exports[`use svgr 3`] = `
131131
"import * as __WEBPACK_EXTERNAL_MODULE__assets_logo_js_450929b7__ from "./assets/logo.js";
132-
console.log(__WEBPACK_EXTERNAL_MODULE__assets_logo_js_450929b7__.ReactComponent);
132+
console.log('namedImport', 'ReactComponent', __WEBPACK_EXTERNAL_MODULE__assets_logo_js_450929b7__.ReactComponent);
133133
"
134134
`;
135135

136136
exports[`use svgr 4`] = `
137137
"import * as __WEBPACK_EXTERNAL_MODULE__assets_logo_js_450929b7__ from "./assets/logo.js";
138-
console.log(__WEBPACK_EXTERNAL_MODULE__assets_logo_js_450929b7__.ReactComponent);
138+
console.log('namedImport', 'ReactComponent', __WEBPACK_EXTERNAL_MODULE__assets_logo_js_450929b7__.ReactComponent);
139139
"
140140
`;
141141

142142
exports[`use svgr 5`] = `
143143
""use strict";
144144
var __webpack_exports__ = {};
145145
const logo_cjs_namespaceObject = require("./assets/logo.cjs");
146-
console.log(logo_cjs_namespaceObject.ReactComponent);
146+
console.log('namedImport', 'ReactComponent', logo_cjs_namespaceObject.ReactComponent);
147147
var __webpack_export_target__ = exports;
148148
for(var __webpack_i__ in __webpack_exports__)__webpack_export_target__[__webpack_i__] = __webpack_exports__[__webpack_i__];
149149
if (__webpack_exports__.__esModule) Object.defineProperty(__webpack_export_target__, '__esModule', {
@@ -156,7 +156,7 @@ exports[`use svgr 6`] = `
156156
""use strict";
157157
var __webpack_exports__ = {};
158158
const logo_cjs_namespaceObject = require("./assets/logo.cjs");
159-
console.log(logo_cjs_namespaceObject.ReactComponent);
159+
console.log('namedImport', 'ReactComponent', logo_cjs_namespaceObject.ReactComponent);
160160
var __webpack_export_target__ = exports;
161161
for(var __webpack_i__ in __webpack_exports__)__webpack_export_target__[__webpack_i__] = __webpack_exports__[__webpack_i__];
162162
if (__webpack_exports__.__esModule) Object.defineProperty(__webpack_export_target__, '__esModule', {
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
import svgUrl from './assets/logo.svg';
22

3-
console.log(svgUrl);
3+
console.log('default Import', 'reexport', svgUrl);
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
import { ReactComponent } from './assets/logo.svg';
22

3-
console.log(ReactComponent);
3+
console.log('namedImport', 'ReactComponent', ReactComponent);
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
import logo from './assets/logo.svg?react';
1+
import ReactComponent from './assets/logo.svg?react';
22

3-
console.log(logo);
3+
console.log('queryImport', 'ReactComponent', ReactComponent);

tests/integration/bundle-false/__snapshots__/index.test.ts.snap

Lines changed: 40 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -3,128 +3,93 @@
33
exports[`svgr in bundleless 1`] = `
44
"import __rslib_svgr_url__0__ from "../static/svg/logo.svg";
55
import * as __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__ from "react/jsx-runtime";
6-
import * as __WEBPACK_EXTERNAL_MODULE_react__ from "react";
7-
8-
;// CONCATENATED MODULE: external "react/jsx-runtime"
9-
10-
;// CONCATENATED MODULE: external "react"
11-
12-
;// CONCATENATED MODULE: ./src/assets/logo.svg?__rslib_entry__
13-
14-
15-
const SvgLogo = (props)=>/*#__PURE__*/ (0,__WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)("svg", {
6+
import "react";
7+
const SvgLogo = (props)=>/*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)("svg", {
168
xmlns: "http://www.w3.org/2000/svg",
179
viewBox: "0 0 841.9 595.3",
1810
...props,
19-
children: /*#__PURE__*/ (0,__WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsxs)("g", {
11+
children: /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsxs)("g", {
2012
fill: "#61DAFB",
2113
children: [
22-
/*#__PURE__*/ (0,__WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)("path", {
14+
/*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)("path", {
2315
d: "M666.3 296.5c0-32.5-40.7-63.3-103.1-82.4 14.4-63.6 8-114.2-20.2-130.4-6.5-3.8-14.1-5.6-22.4-5.6v22.3c4.6 0 8.3.9 11.4 2.6 13.6 7.8 19.5 37.5 14.9 75.7-1.1 9.4-2.9 19.3-5.1 29.4-19.6-4.8-41-8.5-63.5-10.9-13.5-18.5-27.5-35.3-41.6-50 32.6-30.3 63.2-46.9 84-46.9V78c-27.5 0-63.5 19.6-99.9 53.6-36.4-33.8-72.4-53.2-99.9-53.2v22.3c20.7 0 51.4 16.5 84 46.6-14 14.7-28 31.4-41.3 49.9-22.6 2.4-44 6.1-63.6 11-2.3-10-4-19.7-5.2-29-4.7-38.2 1.1-67.9 14.6-75.8 3-1.8 6.9-2.6 11.5-2.6V78.5c-8.4 0-16 1.8-22.6 5.6-28.1 16.2-34.4 66.7-19.9 130.1-62.2 19.2-102.7 49.9-102.7 82.3 0 32.5 40.7 63.3 103.1 82.4-14.4 63.6-8 114.2 20.2 130.4 6.5 3.8 14.1 5.6 22.5 5.6 27.5 0 63.5-19.6 99.9-53.6 36.4 33.8 72.4 53.2 99.9 53.2 8.4 0 16-1.8 22.6-5.6 28.1-16.2 34.4-66.7 19.9-130.1 62-19.1 102.5-49.9 102.5-82.3m-130.2-66.7c-3.7 12.9-8.3 26.2-13.5 39.5-4.1-8-8.4-16-13.1-24-4.6-8-9.5-15.8-14.4-23.4 14.2 2.1 27.9 4.7 41 7.9m-45.8 106.5c-7.8 13.5-15.8 26.3-24.1 38.2-14.9 1.3-30 2-45.2 2-15.1 0-30.2-.7-45-1.9-8.3-11.9-16.4-24.6-24.2-38-7.6-13.1-14.5-26.4-20.8-39.8 6.2-13.4 13.2-26.8 20.7-39.9 7.8-13.5 15.8-26.3 24.1-38.2 14.9-1.3 30-2 45.2-2 15.1 0 30.2.7 45 1.9 8.3 11.9 16.4 24.6 24.2 38 7.6 13.1 14.5 26.4 20.8 39.8-6.3 13.4-13.2 26.8-20.7 39.9m32.3-13c5.4 13.4 10 26.8 13.8 39.8-13.1 3.2-26.9 5.9-41.2 8 4.9-7.7 9.8-15.6 14.4-23.7 4.6-8 8.9-16.1 13-24.1M421.2 430c-9.3-9.6-18.6-20.3-27.8-32 9 .4 18.2.7 27.5.7 9.4 0 18.7-.2 27.8-.7-9 11.7-18.3 22.4-27.5 32m-74.4-58.9c-14.2-2.1-27.9-4.7-41-7.9 3.7-12.9 8.3-26.2 13.5-39.5 4.1 8 8.4 16 13.1 24q7.05 12 14.4 23.4M420.7 163c9.3 9.6 18.6 20.3 27.8 32-9-.4-18.2-.7-27.5-.7-9.4 0-18.7.2-27.8.7 9-11.7 18.3-22.4 27.5-32m-74 58.9c-4.9 7.7-9.8 15.6-14.4 23.7-4.6 8-8.9 16-13 24-5.4-13.4-10-26.8-13.8-39.8 13.1-3.1 26.9-5.8 41.2-7.9m-90.5 125.2c-35.4-15.1-58.3-34.9-58.3-50.6s22.9-35.6 58.3-50.6c8.6-3.7 18-7 27.7-10.1 5.7 19.6 13.2 40 22.5 60.9-9.2 20.8-16.6 41.1-22.2 60.6-9.9-3.1-19.3-6.5-28-10.2M310 490c-13.6-7.8-19.5-37.5-14.9-75.7 1.1-9.4 2.9-19.3 5.1-29.4 19.6 4.8 41 8.5 63.5 10.9 13.5 18.5 27.5 35.3 41.6 50-32.6 30.3-63.2 46.9-84 46.9-4.5-.1-8.3-1-11.3-2.7m237.2-76.2c4.7 38.2-1.1 67.9-14.6 75.8-3 1.8-6.9 2.6-11.5 2.6-20.7 0-51.4-16.5-84-46.6 14-14.7 28-31.4 41.3-49.9 22.6-2.4 44-6.1 63.6-11 2.3 10.1 4.1 19.8 5.2 29.1m38.5-66.7c-8.6 3.7-18 7-27.7 10.1-5.7-19.6-13.2-40-22.5-60.9 9.2-20.8 16.6-41.1 22.2-60.6 9.9 3.1 19.3 6.5 28.1 10.2 35.4 15.1 58.3 34.9 58.3 50.6-.1 15.7-23 35.6-58.4 50.6M320.8 78.4"
2416
}),
25-
/*#__PURE__*/ (0,__WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)("circle", {
17+
/*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)("circle", {
2618
cx: 420.9,
2719
cy: 296.5,
2820
r: 45.7
2921
}),
30-
/*#__PURE__*/ (0,__WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)("path", {
22+
/*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)("path", {
3123
d: "M520.5 78.1"
3224
})
3325
]
3426
})
3527
});
36-
37-
/* ESM default export */ const logo_rslib_entry_ = __rslib_svgr_url__0__;
38-
28+
const logo_rslib_entry_ = __rslib_svgr_url__0__;
3929
export { SvgLogo as ReactComponent, logo_rslib_entry_ as default };
4030
"
4131
`;
4232

4333
exports[`svgr in bundleless 2`] = `
4434
""use strict";
45-
const __rslib_import_meta_url__ = /*#__PURE__*/ (function () {
46-
return typeof document === 'undefined'
47-
? new (require('url'.replace('', '')).URL)('file:' + __filename).href
48-
: (document.currentScript && document.currentScript.src) ||
49-
new URL('main.js', document.baseURI).href;
50-
})();
51-
;
52-
// The require scope
5335
var __webpack_require__ = {};
54-
55-
/************************************************************************/
56-
// webpack/runtime/define_property_getters
57-
(() => {
58-
__webpack_require__.d = function(exports, definition) {
59-
for(var key in definition) {
60-
if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
61-
Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
62-
}
63-
}
64-
};
36+
(()=>{
37+
__webpack_require__.d = function(exports1, definition) {
38+
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
39+
enumerable: true,
40+
get: definition[key]
41+
});
42+
};
6543
})();
66-
// webpack/runtime/has_own_property
67-
(() => {
68-
__webpack_require__.o = function (obj, prop) {
69-
return Object.prototype.hasOwnProperty.call(obj, prop);
70-
};
71-
44+
(()=>{
45+
__webpack_require__.o = function(obj, prop) {
46+
return Object.prototype.hasOwnProperty.call(obj, prop);
47+
};
7248
})();
73-
// webpack/runtime/make_namespace_object
74-
(() => {
75-
// define __esModule on exports
76-
__webpack_require__.r = function(exports) {
77-
if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
78-
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
79-
}
80-
Object.defineProperty(exports, '__esModule', { value: true });
81-
};
82-
49+
(()=>{
50+
__webpack_require__.r = function(exports1) {
51+
if ('undefined' != typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
52+
value: 'Module'
53+
});
54+
Object.defineProperty(exports1, '__esModule', {
55+
value: true
56+
});
57+
};
8358
})();
84-
/************************************************************************/
8559
var __webpack_exports__ = {};
86-
// ESM COMPAT FLAG
8760
__webpack_require__.r(__webpack_exports__);
88-
89-
// EXPORTS
9061
__webpack_require__.d(__webpack_exports__, {
91-
ReactComponent: () => (/* binding */ SvgLogo),
92-
"default": () => (/* binding */ logo_rslib_entry_)
62+
ReactComponent: ()=>SvgLogo,
63+
default: ()=>logo_rslib_entry_
9364
});
94-
95-
;// CONCATENATED MODULE: external "react/jsx-runtime"
9665
const jsx_runtime_namespaceObject = require("react/jsx-runtime");
97-
;// CONCATENATED MODULE: external "react"
98-
const external_react_namespaceObject = require("react");
99-
;// CONCATENATED MODULE: ./src/assets/logo.svg?__rslib_entry__
100-
101-
102-
const SvgLogo = (props)=>/*#__PURE__*/ (0,jsx_runtime_namespaceObject.jsx)("svg", {
66+
require("react");
67+
const SvgLogo = (props)=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("svg", {
10368
xmlns: "http://www.w3.org/2000/svg",
10469
viewBox: "0 0 841.9 595.3",
10570
...props,
106-
children: /*#__PURE__*/ (0,jsx_runtime_namespaceObject.jsxs)("g", {
71+
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("g", {
10772
fill: "#61DAFB",
10873
children: [
109-
/*#__PURE__*/ (0,jsx_runtime_namespaceObject.jsx)("path", {
74+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("path", {
11075
d: "M666.3 296.5c0-32.5-40.7-63.3-103.1-82.4 14.4-63.6 8-114.2-20.2-130.4-6.5-3.8-14.1-5.6-22.4-5.6v22.3c4.6 0 8.3.9 11.4 2.6 13.6 7.8 19.5 37.5 14.9 75.7-1.1 9.4-2.9 19.3-5.1 29.4-19.6-4.8-41-8.5-63.5-10.9-13.5-18.5-27.5-35.3-41.6-50 32.6-30.3 63.2-46.9 84-46.9V78c-27.5 0-63.5 19.6-99.9 53.6-36.4-33.8-72.4-53.2-99.9-53.2v22.3c20.7 0 51.4 16.5 84 46.6-14 14.7-28 31.4-41.3 49.9-22.6 2.4-44 6.1-63.6 11-2.3-10-4-19.7-5.2-29-4.7-38.2 1.1-67.9 14.6-75.8 3-1.8 6.9-2.6 11.5-2.6V78.5c-8.4 0-16 1.8-22.6 5.6-28.1 16.2-34.4 66.7-19.9 130.1-62.2 19.2-102.7 49.9-102.7 82.3 0 32.5 40.7 63.3 103.1 82.4-14.4 63.6-8 114.2 20.2 130.4 6.5 3.8 14.1 5.6 22.5 5.6 27.5 0 63.5-19.6 99.9-53.6 36.4 33.8 72.4 53.2 99.9 53.2 8.4 0 16-1.8 22.6-5.6 28.1-16.2 34.4-66.7 19.9-130.1 62-19.1 102.5-49.9 102.5-82.3m-130.2-66.7c-3.7 12.9-8.3 26.2-13.5 39.5-4.1-8-8.4-16-13.1-24-4.6-8-9.5-15.8-14.4-23.4 14.2 2.1 27.9 4.7 41 7.9m-45.8 106.5c-7.8 13.5-15.8 26.3-24.1 38.2-14.9 1.3-30 2-45.2 2-15.1 0-30.2-.7-45-1.9-8.3-11.9-16.4-24.6-24.2-38-7.6-13.1-14.5-26.4-20.8-39.8 6.2-13.4 13.2-26.8 20.7-39.9 7.8-13.5 15.8-26.3 24.1-38.2 14.9-1.3 30-2 45.2-2 15.1 0 30.2.7 45 1.9 8.3 11.9 16.4 24.6 24.2 38 7.6 13.1 14.5 26.4 20.8 39.8-6.3 13.4-13.2 26.8-20.7 39.9m32.3-13c5.4 13.4 10 26.8 13.8 39.8-13.1 3.2-26.9 5.9-41.2 8 4.9-7.7 9.8-15.6 14.4-23.7 4.6-8 8.9-16.1 13-24.1M421.2 430c-9.3-9.6-18.6-20.3-27.8-32 9 .4 18.2.7 27.5.7 9.4 0 18.7-.2 27.8-.7-9 11.7-18.3 22.4-27.5 32m-74.4-58.9c-14.2-2.1-27.9-4.7-41-7.9 3.7-12.9 8.3-26.2 13.5-39.5 4.1 8 8.4 16 13.1 24q7.05 12 14.4 23.4M420.7 163c9.3 9.6 18.6 20.3 27.8 32-9-.4-18.2-.7-27.5-.7-9.4 0-18.7.2-27.8.7 9-11.7 18.3-22.4 27.5-32m-74 58.9c-4.9 7.7-9.8 15.6-14.4 23.7-4.6 8-8.9 16-13 24-5.4-13.4-10-26.8-13.8-39.8 13.1-3.1 26.9-5.8 41.2-7.9m-90.5 125.2c-35.4-15.1-58.3-34.9-58.3-50.6s22.9-35.6 58.3-50.6c8.6-3.7 18-7 27.7-10.1 5.7 19.6 13.2 40 22.5 60.9-9.2 20.8-16.6 41.1-22.2 60.6-9.9-3.1-19.3-6.5-28-10.2M310 490c-13.6-7.8-19.5-37.5-14.9-75.7 1.1-9.4 2.9-19.3 5.1-29.4 19.6 4.8 41 8.5 63.5 10.9 13.5 18.5 27.5 35.3 41.6 50-32.6 30.3-63.2 46.9-84 46.9-4.5-.1-8.3-1-11.3-2.7m237.2-76.2c4.7 38.2-1.1 67.9-14.6 75.8-3 1.8-6.9 2.6-11.5 2.6-20.7 0-51.4-16.5-84-46.6 14-14.7 28-31.4 41.3-49.9 22.6-2.4 44-6.1 63.6-11 2.3 10.1 4.1 19.8 5.2 29.1m38.5-66.7c-8.6 3.7-18 7-27.7 10.1-5.7-19.6-13.2-40-22.5-60.9 9.2-20.8 16.6-41.1 22.2-60.6 9.9 3.1 19.3 6.5 28.1 10.2 35.4 15.1 58.3 34.9 58.3 50.6-.1 15.7-23 35.6-58.4 50.6M320.8 78.4"
11176
}),
112-
/*#__PURE__*/ (0,jsx_runtime_namespaceObject.jsx)("circle", {
77+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("circle", {
11378
cx: 420.9,
11479
cy: 296.5,
11580
r: 45.7
11681
}),
117-
/*#__PURE__*/ (0,jsx_runtime_namespaceObject.jsx)("path", {
82+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("path", {
11883
d: "M520.5 78.1"
11984
})
12085
]
12186
})
12287
});
123-
124-
/* ESM default export */ const logo_rslib_entry_ = require("../static/svg/logo.svg");
125-
88+
const logo_rslib_entry_ = require("../static/svg/logo.svg");
12689
var __webpack_export_target__ = exports;
127-
for(var __webpack_i__ in __webpack_exports__) __webpack_export_target__[__webpack_i__] = __webpack_exports__[__webpack_i__];
128-
if(__webpack_exports__.__esModule) Object.defineProperty(__webpack_export_target__, '__esModule', { value: true });
90+
for(var __webpack_i__ in __webpack_exports__)__webpack_export_target__[__webpack_i__] = __webpack_exports__[__webpack_i__];
91+
if (__webpack_exports__.__esModule) Object.defineProperty(__webpack_export_target__, '__esModule', {
92+
value: true
93+
});
12994
"
13095
`;

tests/integration/bundle-false/svgr/rslib.config.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ export default defineConfig({
1919
},
2020
output: {
2121
target: 'web',
22-
minify: false,
2322
},
2423
plugins: [pluginReact(), pluginSvgr({ mixedImport: true })],
2524
});

0 commit comments

Comments
 (0)