Path aliases for imports in WebStorm

前端 未结 10 1893
日久生厌
日久生厌 2020-12-02 05:31

I use webpack path aliases for ES6 module loading.

E.g. If I define an alias for utils instead of something like
import Foo from \".

10条回答
  •  离开以前
    2020-12-02 06:31

    Webstorm can't read webpack.config if module.exports return a function. For example

    module.exports = function (webpackEnv) {
      return {
        mode: isEnvProduction ? 'production' : isEnvDevelopment && 'development',
        ...
     }
    }
    

    Check your config file, maybe this cause you are a problem.

提交回复
热议问题