webpack: Module not found: Error: Can't resolve (with relative path)

前端 未结 10 2097
长情又很酷
长情又很酷 2021-02-05 06:34

I have this structure of an app (node_modules dir excluded from this list):

├── actions.js
├── bundle.js
├── components
│   ├── App.js
│   ├── Foote         


        
10条回答
  •  轮回少年
    2021-02-05 07:05

    I met this problem with typescript but forgot to add ts and tsx suffix to resolve entry.

    module.exports = {
      ...
      resolve: {
        extensions: ['.js', '.jsx', '.ts', '.tsx'],
      },
    };
    

    This does the job for me

提交回复
热议问题