I try to build next.js project with typescript and stylus using next-compose-plugins.
My next.config.js:
const withPlugins = require('next-compose-plugins')
const withTypescript = require('@zeit/next-typescript')
const withStylus = require('@zeit/next-stylus')
module.exports = withPlugins([
[withTypescript, {
webpack(config, options) {
config.node = {
fs: 'empty',
}
return config
},
typescriptLoaderOptions: {
transpileOnly: false,
}
}],
[withStylus, {
cssModules: true,
}],
])
In my button.tsx
I'm importing stylus file:
import styles from './button.styl'
console.log(styles) // undefined
button.styl contains class names I'd like to use in my components but instead getting undefined
.
I've added declare module '*.styl'
to my externals.d.ts
and included it in include
section of tsconfig.json
What am I doing wrong?
UPD: getting same issue for @zeit/next-css
.