vite-plugin-storybook-nextjs 3.0.2 → 3.0.3--canary.ca2a5b0.0
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 +4 -4
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -23,9 +23,9 @@ var options_js = require('next/dist/build/swc/options.js');
|
|
|
23
23
|
var nextServerConfig = require('next/dist/server/config.js');
|
|
24
24
|
var constants_js = require('next/dist/shared/lib/constants.js');
|
|
25
25
|
var MagicString = require('magic-string');
|
|
26
|
+
var posix = require('path/posix');
|
|
26
27
|
var querystring = require('querystring');
|
|
27
28
|
var imageSize = require('image-size');
|
|
28
|
-
var posix = require('path/posix');
|
|
29
29
|
|
|
30
30
|
var _documentCurrentScript = typeof document !== 'undefined' ? document.currentScript : null;
|
|
31
31
|
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
@@ -2770,7 +2770,7 @@ function vitePluginNextImage(nextConfigResolver) {
|
|
|
2770
2770
|
}
|
|
2771
2771
|
if (includePattern2.test(source) && !excludeImporterPattern.test(importer ?? "") && !importer?.startsWith(virtualImage)) {
|
|
2772
2772
|
const isAbsolute = path2__default.default.isAbsolute(id);
|
|
2773
|
-
const imagePath = importer ? isAbsolute ? source :
|
|
2773
|
+
const imagePath = importer ? isAbsolute ? source : posix.join(path2__default.default.dirname(importer), source) : source;
|
|
2774
2774
|
return `${virtualImage}?${querystring.encode({ imagePath })}`;
|
|
2775
2775
|
}
|
|
2776
2776
|
if (id === "next/image" && importer !== virtualNextImage) {
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import path2, { resolve, join } from 'path';
|
|
1
|
+
import path2, { resolve, join as join$1 } from 'path';
|
|
2
2
|
import { createRequire } from 'module';
|
|
3
3
|
import tsconfigPaths from 'vite-tsconfig-paths';
|
|
4
4
|
import fs3 from 'fs';
|
|
@@ -21,9 +21,9 @@ 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 { join, resolve as resolve$1, sep } from 'path/posix';
|
|
24
25
|
import { decode, encode } from 'querystring';
|
|
25
26
|
import { imageSize } from 'image-size';
|
|
26
|
-
import { resolve as resolve$1, sep } from 'path/posix';
|
|
27
27
|
|
|
28
28
|
var __create = Object.create;
|
|
29
29
|
var __defProp = Object.defineProperty;
|
|
@@ -1956,7 +1956,7 @@ async function loadClosestPackageJson(dir, attempts = 1) {
|
|
|
1956
1956
|
const mainPath = attempts === 1 ? ["."] : new Array(attempts).fill("..");
|
|
1957
1957
|
try {
|
|
1958
1958
|
const file = await fs3.promises.readFile(
|
|
1959
|
-
join(dir, ...mainPath, "package.json"),
|
|
1959
|
+
join$1(dir, ...mainPath, "package.json"),
|
|
1960
1960
|
"utf8"
|
|
1961
1961
|
);
|
|
1962
1962
|
return JSON.parse(file);
|
|
@@ -2736,7 +2736,7 @@ function vitePluginNextImage(nextConfigResolver) {
|
|
|
2736
2736
|
}
|
|
2737
2737
|
if (includePattern2.test(source) && !excludeImporterPattern.test(importer ?? "") && !importer?.startsWith(virtualImage)) {
|
|
2738
2738
|
const isAbsolute = path2.isAbsolute(id);
|
|
2739
|
-
const imagePath = importer ? isAbsolute ? source :
|
|
2739
|
+
const imagePath = importer ? isAbsolute ? source : join(path2.dirname(importer), source) : source;
|
|
2740
2740
|
return `${virtualImage}?${encode({ imagePath })}`;
|
|
2741
2741
|
}
|
|
2742
2742
|
if (id === "next/image" && importer !== virtualNextImage) {
|