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
Thomas Lindstrøm 6e5d57dae9 Add example with-scoped-stylesheets-and-postcss (#1146)
* 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`
2017-02-17 16:04:58 +01:00

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
}
}