mirror of
https://github.com/terribleplan/next.js.git
synced 2024-01-19 02:48:18 +00:00
6e5d57dae9
* Add example `with-external-stylesheets-and-postcss` * 🔥 Remove extra semi-colon * 📝 Attribute `with-global-stylesheet` * Force a new test * 📝 Update README.md * Rename `external` -> `scoped`
44 lines
1,007 B
JavaScript
44 lines
1,007 B
JavaScript
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
|
|
}
|
|
}
|