vite-plugin-storybook-nextjs 3.0.1 → 3.0.2
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/dist/index.cjs +2 -2
- package/dist/index.js +3 -3
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -2771,7 +2771,7 @@ function vitePluginNextImage(nextConfigResolver) {
|
|
|
2771
2771
|
if (includePattern2.test(source) && !excludeImporterPattern.test(importer ?? "") && !importer?.startsWith(virtualImage)) {
|
|
2772
2772
|
const isAbsolute = path2__default.default.isAbsolute(id);
|
|
2773
2773
|
const imagePath = importer ? isAbsolute ? source : path2__default.default.join(path2__default.default.dirname(importer), source) : source;
|
|
2774
|
-
return `${virtualImage}
|
|
2774
|
+
return `${virtualImage}?${querystring.encode({ imagePath })}`;
|
|
2775
2775
|
}
|
|
2776
2776
|
if (id === "next/image" && importer !== virtualNextImage) {
|
|
2777
2777
|
return virtualNextImage;
|
|
@@ -2818,7 +2818,7 @@ function vitePluginNextImage(nextConfigResolver) {
|
|
|
2818
2818
|
};
|
|
2819
2819
|
`;
|
|
2820
2820
|
} catch (err) {
|
|
2821
|
-
console.error(`Could not read
|
|
2821
|
+
console.error(`Could not read image file ${imagePath}:`, err);
|
|
2822
2822
|
return void 0;
|
|
2823
2823
|
}
|
|
2824
2824
|
}
|
package/dist/index.js
CHANGED
|
@@ -21,7 +21,7 @@ import { getParserOptions } from 'next/dist/build/swc/options.js';
|
|
|
21
21
|
import nextServerConfig from 'next/dist/server/config.js';
|
|
22
22
|
import { PHASE_DEVELOPMENT_SERVER, PHASE_TEST, PHASE_PRODUCTION_BUILD } from 'next/dist/shared/lib/constants.js';
|
|
23
23
|
import MagicString from 'magic-string';
|
|
24
|
-
import { decode } from 'querystring';
|
|
24
|
+
import { decode, encode } from 'querystring';
|
|
25
25
|
import { imageSize } from 'image-size';
|
|
26
26
|
import { resolve as resolve$1, sep } from 'path/posix';
|
|
27
27
|
|
|
@@ -2737,7 +2737,7 @@ function vitePluginNextImage(nextConfigResolver) {
|
|
|
2737
2737
|
if (includePattern2.test(source) && !excludeImporterPattern.test(importer ?? "") && !importer?.startsWith(virtualImage)) {
|
|
2738
2738
|
const isAbsolute = path2.isAbsolute(id);
|
|
2739
2739
|
const imagePath = importer ? isAbsolute ? source : path2.join(path2.dirname(importer), source) : source;
|
|
2740
|
-
return `${virtualImage}
|
|
2740
|
+
return `${virtualImage}?${encode({ imagePath })}`;
|
|
2741
2741
|
}
|
|
2742
2742
|
if (id === "next/image" && importer !== virtualNextImage) {
|
|
2743
2743
|
return virtualNextImage;
|
|
@@ -2784,7 +2784,7 @@ function vitePluginNextImage(nextConfigResolver) {
|
|
|
2784
2784
|
};
|
|
2785
2785
|
`;
|
|
2786
2786
|
} catch (err) {
|
|
2787
|
-
console.error(`Could not read
|
|
2787
|
+
console.error(`Could not read image file ${imagePath}:`, err);
|
|
2788
2788
|
return void 0;
|
|
2789
2789
|
}
|
|
2790
2790
|
}
|