Skip to content

Example with typescript? #274

Open
Open
@tomasz-szepczynski

Description

@tomasz-szepczynski

1)Following the tutorial and modyfing .babelrc did not change 'stylename' to 'classname'.
webpack.js:
const context = path.resolve(__dirname, '..');
.babelrc

["react-css-modules", {
    "webpackHotModuleReloading": true,
    "context": ".."
  }],

2)I tried config from demo example :

  {
    test: /\.tsx?$/,
    loader: 'ts-loader',
    query: {
      plugins: [
        '@babel/transform-react-jsx',
        [
          'react-css-modules',
          {
            context
          }
        ]
      ]
    }
  }

but it won't work with ts-loader
Error: ts-loader was supplied with an unexpected loader option: plugins

Can you please provide example how to use it with ts?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions