Skip to content
This repository has been archived by the owner on Jul 6, 2021. It is now read-only.

Base styles is loaded multiple times in the browser #180

Closed
sagartalla opened this issue May 18, 2018 · 0 comments · Fixed by #228
Closed

Base styles is loaded multiple times in the browser #180

sagartalla opened this issue May 18, 2018 · 0 comments · Fixed by #228
Labels
good first issue Good for newcomers help wanted Extra attention is needed

Comments

@sagartalla
Copy link

I have a base stylus base.styl. I have it imported across multiple styl files for different components.

next.config.js

module.exports = withStylus(withCSS({
  cssModules: true,
  cssLoaderOptions: {
    importLoaders: 1,
    localIdentName: "[local]___[hash:base64:5]",
  },
  webpack: (config, { dev }) => {
    // Fixes npm packages that depend on `fs` module
    config.node = {
      fs: 'empty'
    }
    config = commonsChunkConfig(config, /\.(styl|css)$/);
    return config
  }
}));

How to avoid loading multiple imports in the browser?

image

@timneutkens timneutkens added help wanted Extra attention is needed good first issue Good for newcomers labels May 18, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants