Skip to content
This repository was archived by the owner on Apr 8, 2020. It is now read-only.
This repository was archived by the owner on Apr 8, 2020. It is now read-only.

tsx - Babel loader in webpack.config.js #698

Closed

Description

@martinnov92

Hello, I was having issues with this { test: /\.ts(x?)$/, include: /ClientApp/, use: 'babel-loader' }, in your webpack.config.js (It used to display errors when building minif. production files.).
I change it to { test: /\.js(x?)$/, include: /ClientApp/, use: 'babel-loader' }, and now it's working properly.

Shouldn't it be .js(x?)$: { test: /\.js(x?)$/, include: /ClientApp/, use: 'babel-loader' }, when we are using babel-loader instead of tsx?
Hope it makes sense.
Thank you

Activity

  1. SteveSandersonMS commented on Feb 21, 2017

    @SteveSandersonMS
    Member

    In the React templates in this repo, the source files are .tsx, so the Webpack config is correct as-is. You'd only change it to .jsx if you change your source file names. The fact that you're using babel-loader is not relevant to the loader rules - all that matters are the names of the actual files on disk.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions