Skip to content

Commit

Permalink
docs: add example with css-modules
Browse files Browse the repository at this point in the history
  • Loading branch information
yarastqt committed Feb 25, 2022
1 parent c8fab1a commit f94688b
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ module.exports = withConfig({
```

**If your webpack configuration is already customized:**

```js
const { patchWebpackConfig } = require('next-global-css')

Expand All @@ -43,6 +44,29 @@ const nextConfig = {
}
```

**Allow css-modules from node-modules:**

```js
const { patchWebpackConfig } = require('next-global-css')
const webpackNodeExternals = require('webpack-node-externals')

module.exports = {
reactStrictMode: true,
webpack: (config, options) => {
patchWebpackConfig(config, options)

if (options.isServer) {
config.externals = webpackNodeExternals({
// Uses list to add this modules for server bundle and process.
allowlist: [/design-system/],
})
}

return config
},
}
```

## 📜 License

Project is [MIT licensed](https://github.com/yarastqt/next-global-css/blob/master/license.md).
Expand Down

0 comments on commit f94688b

Please sign in to comment.