vike 0.4.253-commit-332f31b → 0.4.254
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/node/vite/index.js +5 -1
- package/dist/node/vite/shared/isViteCli.js +2 -11
- package/dist/utils/PROJECT_VERSION.d.ts +1 -1
- package/dist/utils/PROJECT_VERSION.js +1 -1
- package/dist/utils/isStorybook.d.ts +2 -0
- package/dist/utils/isStorybook.js +8 -0
- package/dist/utils/isToolCli.d.ts +2 -0
- package/dist/utils/isToolCli.js +7 -0
- package/package.json +1 -1
package/dist/node/vite/index.js
CHANGED
|
@@ -39,6 +39,7 @@ import { pluginViteConfigVikeExtensions } from './plugins/pluginViteConfigVikeEx
|
|
|
39
39
|
import { pluginStripPointerImportAttribute } from './plugins/pluginStripPointerImportAttribute.js';
|
|
40
40
|
import { getVikeConfigInternalEarly, isOnlyResolvingUserConfig } from '../api/resolveViteConfigFromUser.js';
|
|
41
41
|
import './assertEnvVite.js';
|
|
42
|
+
import { isStorybook } from '../../utils/isStorybook.js';
|
|
42
43
|
// We don't call this in ./onLoad.ts to avoid a cyclic dependency with utils.ts
|
|
43
44
|
setGetClientEntrySrcDev(getClientEntrySrcDev);
|
|
44
45
|
assertIsNotProductionRuntime();
|
|
@@ -114,7 +115,10 @@ function removeVitePlugin() {
|
|
|
114
115
|
if (isVitest() && !isVikeCliOrApi()) {
|
|
115
116
|
return true;
|
|
116
117
|
}
|
|
117
|
-
//
|
|
118
|
+
// https://github.com/vikejs/vike/issues/798#issuecomment-1531093835
|
|
119
|
+
if (isStorybook() && !isVikeCliOrApi()) {
|
|
120
|
+
return true;
|
|
121
|
+
}
|
|
118
122
|
return false;
|
|
119
123
|
}
|
|
120
124
|
// Error upon wrong usage
|
|
@@ -1,23 +1,14 @@
|
|
|
1
1
|
export { isViteCli };
|
|
2
2
|
export { getViteConfigForBuildFromCli };
|
|
3
3
|
export { getViteCommandFromCli };
|
|
4
|
-
import { toPosixPath } from '../../../utils/path.js';
|
|
5
4
|
import { assert } from '../../../utils/assert.js';
|
|
6
5
|
import { isObject } from '../../../utils/isObject.js';
|
|
6
|
+
import { isToolCli } from '../../../utils/isToolCli.js';
|
|
7
7
|
import { cac } from 'cac';
|
|
8
8
|
import '../assertEnvVite.js';
|
|
9
9
|
const desc = 'vike:vite-cli-simulation';
|
|
10
10
|
function isViteCli() {
|
|
11
|
-
|
|
12
|
-
assert(execPath);
|
|
13
|
-
execPath = toPosixPath(execPath);
|
|
14
|
-
return (
|
|
15
|
-
// pnpm
|
|
16
|
-
execPath.endsWith('/bin/vite.js') ||
|
|
17
|
-
// npm & yarn
|
|
18
|
-
execPath.endsWith('/.bin/vite') ||
|
|
19
|
-
// Global install
|
|
20
|
-
execPath.endsWith('/bin/vite'));
|
|
11
|
+
return isToolCli('vite');
|
|
21
12
|
}
|
|
22
13
|
function getViteCommandFromCli() {
|
|
23
14
|
if (!isViteCli())
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const PROJECT_VERSION: "0.4.
|
|
1
|
+
export declare const PROJECT_VERSION: "0.4.254";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// Automatically updated by @brillout/release-me
|
|
2
|
-
export const PROJECT_VERSION = '0.4.
|
|
2
|
+
export const PROJECT_VERSION = '0.4.254';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export { isStorybook };
|
|
2
|
+
import { isToolCli } from './isToolCli.js';
|
|
3
|
+
function isStorybook() {
|
|
4
|
+
const TEST_CLI = isToolCli('storybook');
|
|
5
|
+
// https://github.com/storybookjs/storybook/pull/33938
|
|
6
|
+
const TEST_ENV = 'STORYBOOK' in process.env;
|
|
7
|
+
return TEST_ENV || TEST_CLI;
|
|
8
|
+
}
|