W
W
webe2018-09-17 02:42:44
typescript
webe, 2018-09-17 02:42:44

How does TS work?

there is a project on react, there is a webpack and babel with env
I want to hook it into the TS project.
lauder added to webpack:

test: /\.(ts|tsx)$/,
        use: 'ts-loader',

Do I need to run TS files through babel or is ts-loader enough?
I can't figure out TS already has built-in traspiling from ES6/ES7/ES8 to ES5?
those. can i use the same object spread in TS out of the box?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
Y
yanis_kondakov, 2018-09-17
@webe

npm install --save-dev [email protected]8.0.0

module: {
        rules: [{
            test: /\.(tsx?)|(js)$/,
            exclude: /node_modules/,
            loader: 'babel-loader',
        }],
    }

If you are using jsx files, then you need to do it a little differently.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question