1
0
Fork 0
mirror of https://github.com/terribleplan/next.js.git synced 2024-01-19 02:48:18 +00:00
next.js/examples/with-scoped-stylesheets-and-postcss/next.config.js

44 lines
1,007 B
JavaScript
Raw Normal View History

module.exports = {
webpack: (config) => {
config.module.rules.push(
{
test: /\.css$/,
use: [
{
loader: 'emit-file-loader',
options: {
name: 'dist/[path][name].[ext]'
}
},
'raw-loader',
'val-loader',
{
loader: 'skeleton-loader',
options: {
procedure: (content) => (
`${content} \n` + ['module.exports = {',
'stylesheet: module.exports.toString(),',
'classNames: exports.locals',
'}'
].join('')
)
}
},
{
loader: 'css-loader',
options: {
modules: true,
minimize: true,
importLoaders: 1,
localIdentName: '[local]-[hash:base64:5]'
}
},
'postcss-loader'
]
}
)
return config
}
}