You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After the latest update of style-loader and mini-css-extract-loader (where esModule defaults to true), the compilation does not work anymore.
I was able to fix that by replacing
import * as styles from './styles.module.scss';
by
import styles from './styles.module.scss';
But now the generated "styles.module.d.ts" file does not match, since TypeScript complains about the missing default export.
I would need to change that to:
declare const styles: {
// My classes here
};
export default styles;
Would it make sense to implement a configuration option, which get's a list of all classes as parameter, and which returns a string, which is then used as content of the .d.ts file?
{
loader: 'dts-css-modules-loader',
options: {
banner: '// This file is automatically generated. Do not modify this file manually -- YOUR CHANGES WILL BE ERASED!',
customDeclaration: function (classes) {
let typings = 'declare const styles: {\n';
for (const c of classes) {
typings += `\t'${c}': string;\n`;
}
typings += '};\n\nexport default styles;\n';
return typings;
}
}
},
The text was updated successfully, but these errors were encountered:
After the latest update of
style-loader
andmini-css-extract-loader
(whereesModule
defaults totrue
), the compilation does not work anymore.I was able to fix that by replacing
by
But now the generated "styles.module.d.ts" file does not match, since TypeScript complains about the missing
default
export.I would need to change that to:
Would it make sense to implement a configuration option, which get's a list of all classes as parameter, and which returns a string, which is then used as content of the .d.ts file?
The text was updated successfully, but these errors were encountered: