@itcase/storybook-config 1.2.79 → 1.2.80
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/cjs/components/EmailTemplatePreview.js +1 -1
- package/dist/cjs/decorators/withFormSubmitDecorator.js +0 -1
- package/dist/cjs/decorators/withNextDecorator.js +1 -1
- package/dist/cjs/decorators/withUiDecorator.js +1 -1
- package/dist/cjs/decorators.js +1 -2
- package/dist/components/EmailTemplatePreview/index.d.ts +2 -0
- package/dist/components/EmailTemplatePreview/index.js +38 -0
- package/dist/components/EmailTemplatePreview.js +1 -1
- package/dist/components/FormSubmitWrapper/FormSubmitWrapper.d.ts +14 -0
- package/dist/components/FormSubmitWrapper/FormSubmitWrapper.js +84 -0
- package/dist/components/FormSubmitWrapper/autoSubmitForm.d.ts +2 -0
- package/dist/components/FormSubmitWrapper/autoSubmitForm.js +106 -0
- package/dist/components/FormSubmitWrapper/index.d.ts +2 -0
- package/dist/components/FormSubmitWrapper/index.js +2 -0
- package/dist/config/addons/addonThemes.d.ts +15 -0
- package/dist/config/addons/addonThemes.js +14 -15
- package/dist/config/addons/addonsNextJs.d.ts +2 -0
- package/dist/config/addons/addonsNextJs.js +8 -9
- package/dist/config/addons/addonsReactNative.d.ts +2 -0
- package/dist/config/addons/addonsReactNative.js +6 -7
- package/dist/config/addons/addonsReactNativeWeb.d.ts +2 -0
- package/dist/config/addons/addonsReactNativeWeb.js +2 -3
- package/dist/config/addons/addonsVite.d.ts +2 -0
- package/dist/config/addons/addonsVite.js +8 -9
- package/dist/config/addons/addonsWebpack.d.ts +18 -0
- package/dist/config/addons/addonsWebpack.js +26 -27
- package/dist/config/appearance/appearance.d.ts +1 -0
- package/dist/config/appearance/appearance.js +1 -1
- package/dist/config/backgrounds/backgrounds.d.ts +23 -0
- package/dist/config/backgrounds/backgrounds.js +22 -24
- package/dist/config/code/code.d.ts +8 -0
- package/dist/config/code/code.js +18 -22
- package/dist/config/config/mainConfigNextJsVite.d.ts +10 -0
- package/dist/config/config/mainConfigNextJsVite.js +35 -38
- package/dist/config/config/mainConfigReactNative.d.ts +9 -0
- package/dist/config/config/mainConfigReactNative.js +21 -23
- package/dist/config/config/mainConfigReactNativeWeb.d.ts +23 -0
- package/dist/config/config/mainConfigReactNativeWeb.js +42 -46
- package/dist/config/config/mainConfigVite.d.ts +9 -0
- package/dist/config/config/mainConfigVite.js +75 -80
- package/dist/config/config/mainConfigWebpack.d.ts +9 -0
- package/dist/config/config/mainConfigWebpack.js +39 -64
- package/dist/config/framework/frameworkNextJs.d.ts +4 -0
- package/dist/config/framework/frameworkNextJs.js +3 -4
- package/dist/config/framework/frameworkNextJsVite.d.ts +4 -0
- package/dist/config/framework/frameworkNextJsVite.js +3 -4
- package/dist/config/framework/frameworkReactNative.d.ts +4 -0
- package/dist/config/framework/frameworkReactNative.js +3 -4
- package/dist/config/framework/frameworkReactNativeWeb.d.ts +4 -0
- package/dist/config/framework/frameworkReactNativeWeb.js +3 -4
- package/dist/config/framework/frameworkVite.d.ts +4 -0
- package/dist/config/framework/frameworkVite.js +3 -4
- package/dist/config/framework/frameworkWebpack.d.ts +11 -0
- package/dist/config/framework/frameworkWebpack.js +9 -10
- package/dist/config/main/index.d.ts +26 -0
- package/dist/config/main/index.js +26 -53
- package/dist/config/msw/index.d.ts +2 -0
- package/dist/config/msw/index.js +2 -7
- package/dist/config/msw/mswHandlers.d.ts +5 -0
- package/dist/config/msw/mswHandlers.js +20 -24
- package/dist/config/ondevice/ondeviceBackgrounds.d.ts +8 -0
- package/dist/config/ondevice/ondeviceBackgrounds.js +8 -9
- package/dist/config/preview/index.d.ts +6 -0
- package/dist/config/preview/index.js +6 -13
- package/dist/config/refs/refs.d.ts +13 -0
- package/dist/config/refs/refs.js +12 -13
- package/dist/config/sourceLink/sourceLink.d.ts +35 -0
- package/dist/config/sourceLink/sourceLink.js +32 -36
- package/dist/config/static/staticDirsNextJs.d.ts +5 -0
- package/dist/config/static/staticDirsNextJs.js +5 -6
- package/dist/config/static/staticDirsReactNative.d.ts +2 -0
- package/dist/config/static/staticDirsReactNative.js +2 -3
- package/dist/config/static/staticDirsReactNativeWeb.d.ts +2 -0
- package/dist/config/static/staticDirsReactNativeWeb.js +2 -3
- package/dist/config/static/staticDirsVite.d.ts +5 -0
- package/dist/config/static/staticDirsVite.js +2 -3
- package/dist/config/static/staticDirsWebpack.d.ts +5 -0
- package/dist/config/static/staticDirsWebpack.js +2 -3
- package/dist/config/status/status.d.ts +21 -0
- package/dist/config/status/status.js +23 -24
- package/dist/config/users/authorization.d.ts +22 -0
- package/dist/config/users/authorization.js +6 -8
- package/dist/config/users/users.d.ts +18 -0
- package/dist/config/users/users.js +19 -21
- package/dist/config/viewport/viewport.d.ts +264 -0
- package/dist/config/viewport/viewport.js +23 -25
- package/dist/config/vite/getMediaProxyServerConfig.d.ts +13 -0
- package/dist/config/vite/getMediaProxyServerConfig.js +14 -16
- package/dist/decorators/index.d.ts +8 -0
- package/dist/decorators/index.js +8 -0
- package/dist/decorators/withClearStoresDecorator.d.ts +4 -0
- package/dist/decorators/withExtraProviders.d.ts +2 -0
- package/dist/decorators/withFigmaSourceLink.d.ts +5 -0
- package/dist/decorators/withFormSubmitDecorator.d.ts +2 -0
- package/dist/decorators/withFormSubmitDecorator.js +0 -1
- package/dist/decorators/withLayoutDecorator.d.ts +4 -0
- package/dist/decorators/withNextDecorator.d.ts +9 -0
- package/dist/decorators/withNextDecorator.js +1 -1
- package/dist/decorators/withUiDecorator.d.ts +5 -0
- package/dist/decorators/withUiDecorator.js +1 -1
- package/dist/decorators.js +1 -2
- package/dist/utils/getFigmaSourceLink.d.ts +2 -0
- package/dist/utils/getFigmaSourceLink.js +13 -14
- package/dist/utils/getStoryInfoBlocks.d.ts +2 -0
- package/dist/utils/getStoryInfoBlocks.js +45 -55
- package/dist/utils/handleMSWParameters.d.ts +8 -0
- package/dist/utils/handleMSWParameters.js +18 -27
- package/dist/utils/hasFormParameters.d.ts +2 -0
- package/dist/utils/hasFormParameters.js +6 -9
- package/dist/utils/index.d.ts +7 -0
- package/dist/utils/index.js +9 -17
- package/dist/utils/isVitestEnvironment.d.ts +2 -0
- package/dist/utils/isVitestEnvironment.js +2 -3
- package/dist/utils/storybookServerErrorOnSubmit.d.ts +2 -0
- package/dist/utils/storybookServerErrorOnSubmit.js +12 -19
- package/package.json +50 -43
package/dist/config/code/code.js
CHANGED
|
@@ -1,24 +1,20 @@
|
|
|
1
1
|
const CODE = {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
}
|
|
19
|
-
return result
|
|
2
|
+
codePanel: true,
|
|
3
|
+
source: {
|
|
4
|
+
type: 'dynamic',
|
|
5
|
+
transform: (code, context) => {
|
|
6
|
+
const booleanProps = Object.entries(context.argTypes ?? {})
|
|
7
|
+
.filter(([, v]) => {
|
|
8
|
+
return v?.control === 'boolean' || v?.type?.name === 'boolean';
|
|
9
|
+
})
|
|
10
|
+
.map(([name]) => name);
|
|
11
|
+
let result = code;
|
|
12
|
+
for (const prop of booleanProps) {
|
|
13
|
+
// badge → badge={true}, но не трогаем badge={...} и badgeValue
|
|
14
|
+
result = result.replace(new RegExp(`(\\s)${prop}(?=[\\s/>])`, 'g'), `$1${prop}={true}`);
|
|
15
|
+
}
|
|
16
|
+
return result;
|
|
17
|
+
},
|
|
20
18
|
},
|
|
21
|
-
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
export { CODE }
|
|
19
|
+
};
|
|
20
|
+
export { CODE };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
declare const MAIN_CONFIG_NEXTJS_VITE: {
|
|
2
|
+
env: (config: any) => any;
|
|
3
|
+
viteFinal: (config: any) => Promise<Record<string, any>>;
|
|
4
|
+
core: {
|
|
5
|
+
disableTelemetry: boolean;
|
|
6
|
+
disableWhatsNewNotifications: boolean;
|
|
7
|
+
};
|
|
8
|
+
tags: string[];
|
|
9
|
+
};
|
|
10
|
+
export { MAIN_CONFIG_NEXTJS_VITE };
|
|
@@ -1,39 +1,36 @@
|
|
|
1
|
-
import svgr from 'vite-plugin-svgr'
|
|
2
|
-
|
|
3
|
-
import { getMediaProxyServerConfig } from '../vite/getMediaProxyServerConfig.js'
|
|
4
|
-
|
|
1
|
+
import svgr from 'vite-plugin-svgr';
|
|
2
|
+
import { getMediaProxyServerConfig } from '../vite/getMediaProxyServerConfig.js';
|
|
5
3
|
const MAIN_CONFIG_NEXTJS_VITE = {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
export { MAIN_CONFIG_NEXTJS_VITE }
|
|
4
|
+
env: (config) => ({
|
|
5
|
+
...config,
|
|
6
|
+
REST_BASE_URL: process.env.REST_BASE_URL,
|
|
7
|
+
STORYBOOK_MODE: process.env.STORYBOOK_MODE || '',
|
|
8
|
+
}),
|
|
9
|
+
viteFinal: async (config) => {
|
|
10
|
+
const { mergeConfig } = await import('vite');
|
|
11
|
+
return mergeConfig(config, {
|
|
12
|
+
css: {
|
|
13
|
+
devSourcemap: true,
|
|
14
|
+
},
|
|
15
|
+
optimizeDeps: {
|
|
16
|
+
...config.optimizeDeps,
|
|
17
|
+
exclude: ['react-native', ...(config.optimizeDeps?.exclude ?? [])],
|
|
18
|
+
rolldownOptions: {
|
|
19
|
+
...config.optimizeDeps?.rolldownOptions,
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
plugins: [svgr({ include: '**/*.svg' })],
|
|
23
|
+
resolve: {
|
|
24
|
+
...config.resolve,
|
|
25
|
+
tsconfigPaths: true,
|
|
26
|
+
},
|
|
27
|
+
...getMediaProxyServerConfig(),
|
|
28
|
+
});
|
|
29
|
+
},
|
|
30
|
+
core: {
|
|
31
|
+
disableTelemetry: true,
|
|
32
|
+
disableWhatsNewNotifications: true,
|
|
33
|
+
},
|
|
34
|
+
tags: ['autodocs'],
|
|
35
|
+
};
|
|
36
|
+
export { MAIN_CONFIG_NEXTJS_VITE };
|
|
@@ -1,24 +1,22 @@
|
|
|
1
|
-
import svgr from 'vite-plugin-svgr'
|
|
2
|
-
import tsconfigPaths from 'vite-tsconfig-paths'
|
|
3
|
-
|
|
1
|
+
import svgr from 'vite-plugin-svgr';
|
|
2
|
+
import tsconfigPaths from 'vite-tsconfig-paths';
|
|
4
3
|
const MAIN_CONFIG_REACT_NATIVE = {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
export { MAIN_CONFIG_REACT_NATIVE }
|
|
4
|
+
viteFinal: async (config) => {
|
|
5
|
+
const { mergeConfig } = await import('vite');
|
|
6
|
+
return mergeConfig(config, {
|
|
7
|
+
css: {
|
|
8
|
+
devSourcemap: true,
|
|
9
|
+
},
|
|
10
|
+
optimizeDeps: {
|
|
11
|
+
exclude: ['react-native'],
|
|
12
|
+
},
|
|
13
|
+
plugins: [tsconfigPaths(), svgr({ include: '**/*.svg' })],
|
|
14
|
+
});
|
|
15
|
+
},
|
|
16
|
+
core: {
|
|
17
|
+
disableTelemetry: true,
|
|
18
|
+
disableWhatsNewNotifications: true,
|
|
19
|
+
},
|
|
20
|
+
tags: ['autodocs'],
|
|
21
|
+
};
|
|
22
|
+
export { MAIN_CONFIG_REACT_NATIVE };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
declare const MAIN_CONFIG_REACT_NATIVE_WEB: {
|
|
2
|
+
viteFinal: (viteConfig: any) => Promise<Record<string, any>>;
|
|
3
|
+
addons: string[];
|
|
4
|
+
core: {
|
|
5
|
+
disableTelemetry: boolean;
|
|
6
|
+
disableWhatsNewNotifications: boolean;
|
|
7
|
+
};
|
|
8
|
+
docs: {
|
|
9
|
+
autodocs: boolean;
|
|
10
|
+
};
|
|
11
|
+
framework: {
|
|
12
|
+
name: string;
|
|
13
|
+
};
|
|
14
|
+
stories: string[];
|
|
15
|
+
typescript: {
|
|
16
|
+
reactDocgen: string;
|
|
17
|
+
reactDocgenTypescriptOptions: {
|
|
18
|
+
propFilter: (prop: any) => boolean;
|
|
19
|
+
shouldExtractLiteralValuesFromEnum: boolean;
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
export { MAIN_CONFIG_REACT_NATIVE_WEB };
|
|
@@ -1,48 +1,44 @@
|
|
|
1
|
-
import path from 'path'
|
|
2
|
-
import { fileURLToPath } from 'url'
|
|
3
|
-
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
const __dirname = path.dirname(fileURLToPath(import.meta.url))
|
|
8
|
-
|
|
1
|
+
import path from 'path';
|
|
2
|
+
import { fileURLToPath } from 'url';
|
|
3
|
+
import { mergeConfig } from 'vite';
|
|
4
|
+
import babel from 'vite-plugin-babel';
|
|
5
|
+
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
9
6
|
const MAIN_CONFIG_REACT_NATIVE_WEB = {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
},
|
|
22
|
-
addons: ['@storybook/addon-docs'],
|
|
23
|
-
core: {
|
|
24
|
-
disableTelemetry: true,
|
|
25
|
-
disableWhatsNewNotifications: true,
|
|
26
|
-
},
|
|
27
|
-
docs: {
|
|
28
|
-
autodocs: true,
|
|
29
|
-
},
|
|
30
|
-
framework: {
|
|
31
|
-
name: '@storybook/react-native-web-vite',
|
|
32
|
-
},
|
|
33
|
-
stories: ['../stories/react-native/**/*.stories.?(ts|tsx|js|jsx)'],
|
|
34
|
-
typescript: {
|
|
35
|
-
reactDocgen: 'react-docgen-typescript',
|
|
36
|
-
reactDocgenTypescriptOptions: {
|
|
37
|
-
propFilter: (prop) => {
|
|
38
|
-
if (prop.parent) {
|
|
39
|
-
return !prop.parent.fileName.includes('node_modules')
|
|
40
|
-
}
|
|
41
|
-
return true
|
|
42
|
-
},
|
|
43
|
-
shouldExtractLiteralValuesFromEnum: true,
|
|
7
|
+
viteFinal: async (viteConfig) => {
|
|
8
|
+
return mergeConfig(viteConfig, {
|
|
9
|
+
plugins: [
|
|
10
|
+
babel({
|
|
11
|
+
babelConfig: {
|
|
12
|
+
babelrc: false,
|
|
13
|
+
configFile: path.resolve(__dirname, '../../../babel.config.js'),
|
|
14
|
+
},
|
|
15
|
+
}),
|
|
16
|
+
],
|
|
17
|
+
});
|
|
44
18
|
},
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
19
|
+
addons: ['@storybook/addon-docs'],
|
|
20
|
+
core: {
|
|
21
|
+
disableTelemetry: true,
|
|
22
|
+
disableWhatsNewNotifications: true,
|
|
23
|
+
},
|
|
24
|
+
docs: {
|
|
25
|
+
autodocs: true,
|
|
26
|
+
},
|
|
27
|
+
framework: {
|
|
28
|
+
name: '@storybook/react-native-web-vite',
|
|
29
|
+
},
|
|
30
|
+
stories: ['../stories/react-native/**/*.stories.?(ts|tsx|js|jsx)'],
|
|
31
|
+
typescript: {
|
|
32
|
+
reactDocgen: 'react-docgen-typescript',
|
|
33
|
+
reactDocgenTypescriptOptions: {
|
|
34
|
+
propFilter: (prop) => {
|
|
35
|
+
if (prop.parent) {
|
|
36
|
+
return !prop.parent.fileName.includes('node_modules');
|
|
37
|
+
}
|
|
38
|
+
return true;
|
|
39
|
+
},
|
|
40
|
+
shouldExtractLiteralValuesFromEnum: true,
|
|
41
|
+
},
|
|
42
|
+
},
|
|
43
|
+
};
|
|
44
|
+
export { MAIN_CONFIG_REACT_NATIVE_WEB };
|
|
@@ -1,81 +1,76 @@
|
|
|
1
|
-
import path from 'node:path'
|
|
2
|
-
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
import { getMediaProxyServerConfig } from '../vite/getMediaProxyServerConfig.js'
|
|
6
|
-
|
|
1
|
+
import path from 'node:path';
|
|
2
|
+
import svgr from 'vite-plugin-svgr';
|
|
3
|
+
import { getMediaProxyServerConfig } from '../vite/getMediaProxyServerConfig.js';
|
|
7
4
|
const MAIN_CONFIG_VITE = {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
export { MAIN_CONFIG_VITE }
|
|
5
|
+
viteFinal: async function (config) {
|
|
6
|
+
const { mergeConfig } = await import('vite');
|
|
7
|
+
const existingHmr = config.server?.hmr;
|
|
8
|
+
const existingWatch = config.server?.watch;
|
|
9
|
+
const projectRoot = process.cwd();
|
|
10
|
+
const srcAlias = {
|
|
11
|
+
find: 'src',
|
|
12
|
+
replacement: path.join(projectRoot, 'src'),
|
|
13
|
+
};
|
|
14
|
+
const existingAlias = config.resolve?.alias;
|
|
15
|
+
const alias = Array.isArray(existingAlias)
|
|
16
|
+
? [...existingAlias, srcAlias]
|
|
17
|
+
: existingAlias
|
|
18
|
+
? [existingAlias, srcAlias]
|
|
19
|
+
: [srcAlias];
|
|
20
|
+
return mergeConfig(config, {
|
|
21
|
+
// Включаем source maps для отладки в DevTools
|
|
22
|
+
// Для dev режима Vite автоматически генерирует source maps, но нужно явно указать
|
|
23
|
+
build: {
|
|
24
|
+
...config.build,
|
|
25
|
+
sourcemap: true,
|
|
26
|
+
},
|
|
27
|
+
css: {
|
|
28
|
+
preprocessorOptions: {
|
|
29
|
+
scss: {
|
|
30
|
+
api: 'modern-compiler',
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
optimizeDeps: {
|
|
35
|
+
...config.optimizeDeps,
|
|
36
|
+
rolldownOptions: {
|
|
37
|
+
...config.optimizeDeps?.rolldownOptions,
|
|
38
|
+
},
|
|
39
|
+
},
|
|
40
|
+
plugins: [svgr({ include: '**/*.svg' })],
|
|
41
|
+
resolve: {
|
|
42
|
+
...config.resolve,
|
|
43
|
+
alias: alias,
|
|
44
|
+
tsconfigPaths: true,
|
|
45
|
+
},
|
|
46
|
+
root: projectRoot,
|
|
47
|
+
// Улучшаем HMR для более быстрого обновления и работы с DevTools
|
|
48
|
+
server: {
|
|
49
|
+
...config.server,
|
|
50
|
+
hmr: {
|
|
51
|
+
...(existingHmr && typeof existingHmr === 'object'
|
|
52
|
+
? existingHmr
|
|
53
|
+
: {}),
|
|
54
|
+
overlay: true,
|
|
55
|
+
// Убеждаемся, что HMR работает правильно
|
|
56
|
+
protocol: 'ws',
|
|
57
|
+
},
|
|
58
|
+
// Включаем source maps для dev сервера
|
|
59
|
+
sourcemapIgnoreList: false,
|
|
60
|
+
watch: {
|
|
61
|
+
...(existingWatch && typeof existingWatch === 'object'
|
|
62
|
+
? existingWatch
|
|
63
|
+
: {}),
|
|
64
|
+
usePolling: false,
|
|
65
|
+
},
|
|
66
|
+
...getMediaProxyServerConfig().server,
|
|
67
|
+
},
|
|
68
|
+
});
|
|
69
|
+
},
|
|
70
|
+
core: {
|
|
71
|
+
disableTelemetry: true,
|
|
72
|
+
disableWhatsNewNotifications: true,
|
|
73
|
+
},
|
|
74
|
+
tags: ['autodocs'],
|
|
75
|
+
};
|
|
76
|
+
export { MAIN_CONFIG_VITE };
|
|
@@ -1,66 +1,41 @@
|
|
|
1
|
-
import chalk from 'chalk'
|
|
2
|
-
|
|
3
|
-
const STORYBOOK_PUBLIC_PATH = null
|
|
1
|
+
import chalk from 'chalk';
|
|
2
|
+
const STORYBOOK_PUBLIC_PATH = null;
|
|
4
3
|
const WEBPACK_ALIAS = {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
}
|
|
9
|
-
|
|
4
|
+
src: `${process.cwd()}/src`,
|
|
5
|
+
'@itcase/ui-core': `${process.cwd()}/node_modules/@itcase/ui-core/dist`,
|
|
6
|
+
'@itcase/ui-web': `${process.cwd()}/node_modules/@itcase/ui-web/dist`,
|
|
7
|
+
};
|
|
10
8
|
const MAIN_CONFIG_WEBPACK = {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
)
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
chalk.white('Using default "WEBPACK_ALIAS" from'),
|
|
45
|
-
chalk.cyan('src'),
|
|
46
|
-
chalk.white('to'),
|
|
47
|
-
chalk.cyan(`${process.cwd()}/src`),
|
|
48
|
-
chalk.white('change it to use another one'),
|
|
49
|
-
),
|
|
50
|
-
)
|
|
51
|
-
|
|
52
|
-
config.resolve.alias = {
|
|
53
|
-
...config.resolve.alias,
|
|
54
|
-
...WEBPACK_ALIAS,
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
return config
|
|
58
|
-
},
|
|
59
|
-
core: {
|
|
60
|
-
disableTelemetry: true,
|
|
61
|
-
disableWhatsNewNotifications: true,
|
|
62
|
-
},
|
|
63
|
-
tags: ['autodocs'],
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
export { MAIN_CONFIG_WEBPACK }
|
|
9
|
+
webpackFinal: async (config) => {
|
|
10
|
+
console.log(chalk.green('info =>', chalk.white('Using default "publicPath" set "STORYBOOK_PUBLIC_PATH" variable to use another one')));
|
|
11
|
+
if (STORYBOOK_PUBLIC_PATH) {
|
|
12
|
+
config.output.publicPath = STORYBOOK_PUBLIC_PATH;
|
|
13
|
+
}
|
|
14
|
+
// @svgr/webpack
|
|
15
|
+
const imageRule = config.module?.rules?.find((rule) => {
|
|
16
|
+
const test = rule.test;
|
|
17
|
+
if (!test) {
|
|
18
|
+
return false;
|
|
19
|
+
}
|
|
20
|
+
return test.test('.svg');
|
|
21
|
+
});
|
|
22
|
+
imageRule.exclude = /\.svg$/;
|
|
23
|
+
config.module?.rules?.push({
|
|
24
|
+
test: /\.svg$/,
|
|
25
|
+
use: ['@svgr/webpack'],
|
|
26
|
+
});
|
|
27
|
+
// update webpack alias
|
|
28
|
+
console.log(chalk.green('info =>', chalk.white('Using default "WEBPACK_ALIAS" from'), chalk.cyan('src'), chalk.white('to'), chalk.cyan(`${process.cwd()}/src`), chalk.white('change it to use another one')));
|
|
29
|
+
config.resolve.alias = {
|
|
30
|
+
...config.resolve.alias,
|
|
31
|
+
...WEBPACK_ALIAS,
|
|
32
|
+
};
|
|
33
|
+
return config;
|
|
34
|
+
},
|
|
35
|
+
core: {
|
|
36
|
+
disableTelemetry: true,
|
|
37
|
+
disableWhatsNewNotifications: true,
|
|
38
|
+
},
|
|
39
|
+
tags: ['autodocs'],
|
|
40
|
+
};
|
|
41
|
+
export { MAIN_CONFIG_WEBPACK };
|