s-panferov / awesome-typescript-loader

Awesome TypeScript loader for webpack
Other
2.35k stars 181 forks source link

awesome-typescript-loader with custom tsconfig puts all code in one global chunk #608

Open BiosBoy opened 6 years ago

BiosBoy commented 6 years ago

So, e several days ago, when I tried to migrate from js to ts i had faced with issue in awesome-typescript-loader plugin by using it with tsconfig.json file. For now I cannot spite my code in chunks as it had been with babel loader. For now all my js code just coupling together in one app.js file. That's not very nice for me...

Also, if I removed my tsconfig.json - awesome-typescript-loader has starts to splite my code in chunks normally as expected.

Environment: "awesome-typescript-loader": "^5.2.0", "typescript": "^3.0.1", "webpack": "^4.16.1",

Tsconfig.json file:

{
    "compilerOptions": {
      "allowJs": true,
      "checkJs": false,
      "module": "commonjs",
      "target": "es5",
      "jsx": "react",
      "moduleResolution": "node",
      "lib": ["es2015", "dom"]
    },
    "include": [
      "src/**/"
    ]
  }
jacobrask commented 6 years ago

Try changing "module": "commonjs" to "module": "esnext"

BiosBoy commented 6 years ago

@jacobrask interesting solution, but yes! It works!

Thank you, cheers! :)