fleet/.storybook/main.js
Zach Wasserman 515cdb918c
Replace import-glob-loader with node-sass-glob-importer (#10171)
import-glob-loader has a very old loader-utils dependency that triggers
security alerting. Hoping that replacing this will allow the
loader-utils version to be updated.

# Checklist for submitter

If some of the following don't apply, delete the relevant line.

- [x] Manual QA for all new/changed functionality
2023-03-01 12:33:42 -08:00

42 lines
1.1 KiB
JavaScript

const path = require("path");
const bourbon = require("node-bourbon").includePaths;
const MiniCssExtractPlugin = require("mini-css-extract-plugin");
const globImporter = require("node-sass-glob-importer");
module.exports = {
webpackFinal: async (config) => {
config.module.rules.push({
test: /\.scss$/,
use: [
{
loader: MiniCssExtractPlugin.loader,
options: {
publicPath: "./",
hmr: process.env.NODE_ENV === "development",
},
},
{ loader: "css-loader" },
{ loader: "postcss-loader" },
{
loader: "sass-loader",
options: {
sourceMap: true,
includePaths: [bourbon],
importer: globImporter(),
},
},
],
});
config.plugins.push(new MiniCssExtractPlugin({ filename: "[name].css" }));
config.resolve.modules.push(path.resolve(__dirname, "../frontend"));
return config;
},
stories: [
"../frontend/components/**/*.stories.mdx",
"../frontend/components/**/*.stories.@(js|jsx|ts|tsx)",
],
addons: ["@storybook/addon-links", "@storybook/addon-essentials"],
};