Skip to content

Using Typescript with gem #872

@iporollo

Description

@iporollo

I was wondering if it is possible to use typescript with this gem.

I do not have the config/wepback/loaders folder, but I do have config/weback/evironment.js to which I tried adding a typescript loader like so:

const { environment } = require('@rails/webpacker')

environment.loaders.set('typescript', {
  test: /.(ts|tsx)$/,
  loader: 'ts-loader'
});

module.exports = environment

Apart from adding this to my config/weback/evironment.js, I also ran yarn add ts-loader typescript @types/react @types/react-dom and added a tsconfig.json file.

This process did didn't seem to work, so I was wondering if I am missing a step or if it's even possible.

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions