Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/81.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 资产大小限制:以下资产超过了storybook构建中的建议大小限制(244 KiB)_Javascript_Html_Reactjs_Webpack_Storybook - Fatal编程技术网

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;
  }
};