Skip to content

ExposeRuntimeCssAssetsPlugin error even after adding the plugin #15

@Jagadeeshraj

Description

@Jagadeeshraj

Hi,

I'm trying to integrate the single-spa-css and getting below exception even after adding MiniCssExtractPlugin and ExposeRuntimeCssAssetsPlugin. Let me know if I'm missing something.

error Error: single-spa-css: to use webpackExtractedCss, add ExposeRuntimeCssAssetsPlugin to your webpack config.

Wepack:

module.exports = (config, options) => {
  const singleSpaWebpackConfig = singleSpaAngularWebpack(config, options);
  singleSpaWebpackConfig.externals.push("shareddata");
  const plugins = [
    new MiniCssExtractPlugin({
      filename: "[name].css",
    }),
    new ExposeRuntimeCssAssetsPlugin({
      // The filename here must match the filename for the MiniCssExtractPlugin
      filename: "[name].css",
    }),
  ];
  singleSpaWebpackConfig.plugins = [
    ...singleSpaWebpackConfig.plugins,
    ...plugins,
  ];
  return singleSpaWebpackConfig;
};

Angular: 12.2.14
Webpack: 5.50.0
single-spa: ^5.9.2
single-spa-angular: ^5.0.2
single-spa-css: ^2.0.0

TIA

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions