seek-oss / css-modules-typescript-loader

Webpack loader to create TypeScript declarations for CSS Modules
MIT License
198 stars 27 forks source link

fix: Support @babel/plugin-transform-typescript #24

Closed kepek closed 5 years ago

kepek commented 5 years ago

Workaround for known limitations of @babel/plugin-transform-typescript.

Before:

// This file is automatically generated.
// Please do not change this file!
interface CssExports {
  addToCartButton: string;
  'addToCartButton--error': string;
  'addToCartButton--loading': string;
}
declare const cssExports: CssExports;
export = cssExports;

After:

// This file is automatically generated.
// Please do not change this file!
interface CssExports {
  addToCartButton: string;
  'addToCartButton--error': string;
  'addToCartButton--loading': string;
  superNestedLvl1: string;
}
export const cssExports: CssExports;
export default cssExports;

See more: https://babeljs.io/docs/en/babel-plugin-transform-typescript Docs: https://www.typescriptlang.org/docs/handbook/modules.html#export--and-import--require

dim882 commented 5 years ago

Do you know when this will be merged? It would be really helpful for me. Thanks!