ts-loader: 'externals' in webpack.config.js is ignored

With a webpack config file that has an externals section eg:

module.exports = {
    ...
    externals: {
        hello: true
    },
    ...
}

This section isn’t used by ts-loader and the compile will fail because the module hello can’t be found.

The same project compiles fine from javascript files without ts-loader.

Sample project at https://github.com/stkb/ts-loader-issue

About this issue

  • Original URL
  • State: closed
  • Created 9 years ago
  • Comments: 15 (6 by maintainers)

Commits related to this issue

Most upvoted comments

Thanks @johnnyreilly , installing @types/jquery fixed it. Hmm, I was so confused by the error message.

Do you have @types/jquery installed? Also do you want to try import * as $ from 'jquery'?