awesome-typescript-loader icon indicating copy to clipboard operation
awesome-typescript-loader copied to clipboard

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

Open BiosBoy opened this issue 6 years ago • 2 comments

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/**/"
    ]
  }

BiosBoy avatar Aug 17 '18 07:08 BiosBoy

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

jacobrask avatar Aug 17 '18 10:08 jacobrask

@jacobrask interesting solution, but yes! It works!

Thank you, cheers! :)

BiosBoy avatar Aug 17 '18 11:08 BiosBoy