1.3.1 • Published 2 years ago
next-global-css v1.3.1
next-global-css
A preset for nextjs allowing using 3d party libraries with global css.
⚠️ Be careful, this solution can be unstable due to nextjs updates.
🏗 Compatible
Current version works only for 10th version of nextjs or higher.
☄️ Install and usage
Installation:
npm i -PE next-global-css
Configure:
const { withGlobalCss } = require('next-global-css')
const withConfig = withGlobalCss()
module.exports = withConfig({
/* Next.js config options here */
})
If your webpack configuration is already customized:
const { patchWebpackConfig } = require('next-global-css')
const nextConfig = {
/* config options here */
/* your already customized webpack option */
webpack: (config, options) => {
patchWebpackConfig(config, options)
},
}
Allow css-modules from node-modules:
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.
1.3.1
2 years ago
1.3.1-canary.4af4e9c
2 years ago
1.3.0
2 years ago
1.2.0
3 years ago
1.1.1
3 years ago
1.1.0
3 years ago
0.0.1-beta.6
3 years ago
0.0.1-beta.5
3 years ago
0.0.1-beta.4
3 years ago
0.0.1-beta.3
3 years ago
0.0.1-beta.2
3 years ago
1.0.0
3 years ago