Javascript 资产大小限制:以下资产超过了storybook构建中的建议大小限制(244 KiB)
我试图解决这个问题,当我命令Javascript 资产大小限制:以下资产超过了storybook构建中的建议大小限制(244 KiB),javascript,html,reactjs,webpack,storybook,Javascript,Html,Reactjs,Webpack,Storybook,我试图解决这个问题,当我命令npm运行build storybook 错误: asset size limit: The following asset(s) exceed the recommended size limit (244 KiB). WARN This can impact web performance. WARN Assets: WARN vendors~main.867acf8415a0b04d833b.bundle.js (274 KiB) WARN entrypoi
npm运行build storybook
错误:
asset size limit: The following asset(s) exceed the recommended size limit (244 KiB).
WARN This can impact web performance.
WARN Assets:
WARN vendors~main.867acf8415a0b04d833b.bundle.js (274 KiB)
WARN entrypoint size limit: The following entrypoint(s) combined asset size exceeds the recommended limit (244 KiB). This can impact web performance.
WARN Entrypoints:
WARN main (277 KiB)
WARN runtime~main.867acf8415a0b04d833b.bundle.js
WARN vendors~main.867acf8415a0b04d833b.bundle.js
WARN main.867acf8415a0b04d833b.bundle.js
WARN
WARN webpack performance recommendations:
WARN You can limit the size of your bundles by using import() or require.ensure to lazy load some parts of your application.
WARN For more info visit https://webpack.js.org/guides/code-splitting/
我的配置文件是:
我的min.js
文件是:
有人能想出办法解决这个问题吗
谢谢
import { configure,addDecorator,addParameters } from '@storybook/react';
import {withKnobs } from "@storybook/addon-knobs";
import { withHTML } from '@whitespace/storybook-addon-html/react';
import { withInfo } from '@storybook/addon-info';
import crfTheme from './crfTheme';
// golbal scss
import "../styles/juni/storybook.scss";
//--------- addons--------
addDecorator(withKnobs({
escapeHTML: false,
}));
addDecorator(withHTML);
addDecorator(withInfo);
// automatically import all files ending in *.stories.js
const req = require.context('../stories', true, /\.stories\.js$/);
function loadStories() {
require('./welcomeStory');
req.keys().forEach(filename => req(filename));
}
configure(loadStories, module);
const path = require('path');
// Export a function. Accept the base config as the only param.
module.exports = {
performance: {
hints: false,
},
webpackFinal: async (config, { configType }) => {
// `configType` has a value of 'DEVELOPMENT' or 'PRODUCTION'
// You can change the configuration based on that.
// 'PRODUCTION' is used when building the static version of storybook.
// Make whatever fine-grained changes you need
config.module.rules.push({
test: /\.scss$/,
use: ['style-loader', 'css-loader?url=false', 'sass-loader'],
include: path.resolve(__dirname, '../'),
});
// Return the altered config
return config;
}
};