-
Notifications
You must be signed in to change notification settings - Fork 18
/
main.js
62 lines (49 loc) · 1.67 KB
/
main.js
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
const TsconfigPathsPlugin = require('tsconfig-paths-webpack-plugin');
module.exports = {
core: {
disableTelemetry: true,
},
addons: [{ name: '@storybook/addon-controls' }],
features: {
postcss: true,
},
framework: {
name: '@storybook/angular',
options: {},
},
plugins: [
require('autoprefixer')({
flexbox: 'no-2009',
}),
],
stories: [],
webpackFinal: async config => {
const tsPaths = new TsconfigPathsPlugin({
configFile: './tsconfig.base.json',
});
config.resolve.plugins ? config.resolve.plugins.push(tsPaths) : (config.resolve.plugins = [tsPaths]);
// add your own webpack tweaks below if needed
/**
* Remove html raw loader that breaks Jit compilation as suggested here https://github.com/storybookjs/storybook/issues/16977#issuecomment-1004059631.
* The issue references:
* - https://github.com/storybookjs/storybook/issues/16977#issuecomment-1003399336
* - https://github.com/storybookjs/storybook/issues/16977#issuecomment-1004180729
* Here's what should be removed:
* {
* test: /\.html$/,
* loader: './node_modules/raw-loader/dist/cjs.js',
* exclude: /\.async\.html$/
* },
*/
const rules = (config.module.rules ?? []).filter(rule => !rule.loader?.includes('raw-loader'));
config.module.rules = [...rules];
// adjust file size limits, see docs here https://webpack.js.org/configuration/performance/#performance-maxentrypointsize
config.performance.maxEntrypointSize = 512000;
config.performance.maxAssetSize = 512000;
// add your own webpack tweaks above if needed
return config;
},
docs: {
autodocs: true
}
};