Search code examples
node.jstypescriptwebpackts-loader

On Windows, wepback build is blocked during 'emit' phase


I created a simple webpack project for a Typescript library : https://github.com/lbar/test-webpackts-issue

On linux, npm run build finishes successfully:

> rimraf dist && webpack --progress --profile
10% 0/1 build modulests-loader: Using [email protected] and /tmp/testwebpack/tsconfig.json                                                                                                                                   8030ms1217ms optimi5ms emit
Hash: 8eac1502f3b7a9a19be2
Version: webpack 1.13.1
Time: 2596ms
Asset       Size  Chunks             Chunk Names
index.js  816 bytes       0  [emitted]  index
index.js.map    6.07 kB       0  [emitted]  index
/tmp/testwebpack/dist/index.d.ts   31 bytes          [emitted]
/tmp/testwebpack/dist/src/info.d.ts   49 bytes          [emitted]
+ 2 hidden modules

On Windows, npm run build is blocked during 'emit' phase. The output is :

> rimraf dist && webpack --progress --profile

10% 0/1 build modulests-loader: Using [email protected] and C:\tmp\testwebpack\tsconfig.jso
1836ms build modules
3ms seal
7ms optimize
3ms hashing
7ms create chunk assets
79ms additional chunk assets
19ms optimize chunk assets
837ms optimize assets
95% emit

The version of node differs: 6.2.2 on Windows and 4.4.5 on Linux. I don't know if it may be the cause. Has anyone an idea about the problem? Issue in webpack, ts-loader or typescript?

One more thing, call to tsc is working on both systems.

Thanks for your help


Solution

  • This problem is caused by an issue in ts-loader: https://github.com/TypeStrong/ts-loader/issues/185

    A Pull Request is waiting fixes for project core team.

    Webpack can use "awesome-typescript-loader" to avoid this issue.