-
Notifications
You must be signed in to change notification settings - Fork 2.2k
/
configuration.spec.ts.snap
97 lines (73 loc) · 2.81 KB
/
configuration.spec.ts.snap
1
2
3
4
5
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
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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`@nrwl/storybook:configuration should generate a webpackFinal into the main.js and reference a potential global webpackFinal definition 1`] = `
"const rootMain = require('../../../.storybook/main');
module.exports = {
...rootMain,
core: { ...rootMain.core, builder: 'webpack5' },
stories: [
...rootMain.stories,
'../src/lib/**/*.stories.mdx',
'../src/lib/**/*.stories.@(js|jsx|ts|tsx)'
],
addons: [...rootMain.addons ],
webpackFinal: async (config, { configType }) => {
// apply any global webpack configs that might have been specified in .storybook/main.js
if (rootMain.webpackFinal) {
config = await rootMain.webpackFinal(config, { configType });
}
// remove html raw-loader that breaks Jit compilation
const rules = (config.module.rules ?? []).filter(
(rule) =>
rule.test !== /\\\\.html$/ &&
rule.exclude !== /\\\\.async\\\\.html$/ &&
!rule.loader?.includes('raw-loader')
);
config.module.rules = [...rules];
// add your own webpack tweaks if needed
return config;
},
};
"
`;
exports[`@nrwl/storybook:configuration should have the proper typings 1`] = `
Array [
"../../../node_modules/@nrwl/react/typings/styled-jsx.d.ts",
"../../../node_modules/@nrwl/react/typings/cssmodule.d.ts",
"../../../node_modules/@nrwl/react/typings/image.d.ts",
]
`;
exports[`@nrwl/storybook:configuration should reference the "old" webpack.config.js if there - for backwards compatibility 1`] = `
"const rootMain = require('../../../.storybook/main');
const rootWebpackConfig = require('../../../.storybook/webpack.config');
module.exports = {
...rootMain,
core: { ...rootMain.core, builder: 'webpack5' },
stories: [
...rootMain.stories,
'../src/lib/**/*.stories.mdx',
'../src/lib/**/*.stories.@(js|jsx|ts|tsx)'
],
addons: [...rootMain.addons ],
webpackFinal: async (config, { configType }) => {
// apply any global webpack configs that might have been specified in .storybook/main.js
if (rootMain.webpackFinal) {
config = await rootMain.webpackFinal(config, { configType });
}
// for backwards compatibility call the \`rootWebpackConfig\`
// this can be removed once that one is migrated fully to
// use the \`webpackFinal\` property in the \`main.js\` file
config = rootWebpackConfig({ config });
// remove html raw-loader that breaks Jit compilation
const rules = (config.module.rules ?? []).filter(
(rule) =>
rule.test !== /\\\\.html$/ &&
rule.exclude !== /\\\\.async\\\\.html$/ &&
!rule.loader?.includes('raw-loader')
);
config.module.rules = [...rules];
// add your own webpack tweaks if needed
return config;
},
};
"
`;