在升级模具核心后,我无法在Storybok中加载CSS文件。
.strorybook.webpack.config.ts是伙伴:
const path = require('path');
const CopyWebpackPlugin = require('copy-webpack-plugin');
module.exports = (baseConfig, env, defaultConfig) => {
// We extend the default config by
const copyWebpackPlugin = new CopyWebpackPlugin([
{
from: path.resolve(__dirname, '../node_modules/io-components/components'),
to: path.posix.join('static', 'components'),
ignore: ['.*']
},
{
from: path.resolve(__dirname, '../src/assets'),
to: path.posix.join('static', 'assets'),
ignore: ['.*']
},
{
from: path.resolve(__dirname, '../static/assets/'),
to: path.posix.join('./','assets'),
ignore: ['.*']
},
]
);
if (defaultConfig.plugins) {
defaultConfig.plugins.push(copyWebpackPlugin);
} else {
defaultConfig.plugins = [
copyWebpackPlugin
];
}
return defaultConfig;
};
错误是 错误:ENOENT:没有这样的文件或目录,状态为'/home/chaima/Desktop/io-components/vue-storybook/node_modules/@storybook/core/dist/public/components/components.esm.js'< / strong>