L
L
lex2019-01-11 20:44:33
typescript
lex, 2019-01-11 20:44:33

How to setup ts config and webpack?

Good evening!
There is a section in webpack config

resolve: {
                modules: [
                    'node_modules',
                    'src',
                    'src/system.blocks',
                    'src/common.blocks'
                ],
                extensions: [ 
                    '.mjs',
                    '.js',
                    '.ts',
                    '.tsx',
                    '.json',
                    '.jsx'
                ],
            },

Therefore, I use such imports. But the linter or ts compiler swears in the editor. How to fix it? where to say that everything is ok I get the modules don't worry ?
import Menu from 'Menu/Menu';

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
Interface, 2019-01-12
@Interface

Most likely TS swears. Add appropriate aliases to tsconfig.json for your modules. You can read about how here https://www.typescriptlang.org/docs/handbook/modul...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question