css - 无法为 Storybook Angular 中的外部库正确加载 CSS
问题描述
我正在使用带有项目样式设置的 Angular(使用 --create-application=false),我只是无法让 Storybook 从外部库(如 Angular Material)加载任何 CSS。项目组件 scss 编译并工作正常,但没有一个外部库可以加载任何 css。
这是我的storybook/main.js
-
const path = require('path');
module.exports = {
"stories": [
"../stories/**/*.stories.mdx",
"../stories/**/*.stories.@(js|jsx|ts|tsx)"
],
"addons": [
"@storybook/addon-links",
"@storybook/addon-essentials"
],
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', 'sass-loader'],
include: path.resolve(__dirname, '../'),
});
// Return the altered config
return config;
}
}
这是我的项目结构-
有人可以指出问题所在吗?
解决方案
推荐阅读
- excel - 如果 A 列在 B 列中只有 1 个匹配变量,则突出显示行
- post - 使用 python 请求发布 - 如何获取我请求的正确表格数据?
- python - 来自 seaborn 的 Matplot 区域绘图调色板
- r - 当某些行包含逗号作为千位分隔符和“标志并且没有小数的行没有标志时如何读取R中的数据
- excel - Excel如何找到与另一个日期最接近的日期,匹配两组数据中的相同ID号?
- r - tidyr 传播来自两列的值(并重命名列)
- android - 从 Room DB 获取单个项目。从视图模型调用函数
- php - PHP匿名函数里面没有这个
- sql - 仅当货币不是 0.0000 时才转换 2 个十进制值
- python - 根据数据框中列的阈值条件删除行