-
-
Notifications
You must be signed in to change notification settings - Fork 3.3k
Closed
Labels
Description
Need Update how to write the webpack configuration with typescript. Current configuration is wrong.
ts-node dosenot support the module syntax of other than commonjs module.
So, if module in compilerOptions in tsconfig.json is not commonjs, webpack getting error. like this.
(function (exports, require, module, __filename, __dirname) { import * as path from "path";
^^^^^^
SyntaxError: Unexpected token import
at createScript (vm.js:80:10)
at Object.runInThisContext (vm.js:139:10)
at Module._compile (module.js:588:28)
at Module.m._compile (/Users/hogefuga/webpack-config-with-typescript/node_modules/ts-node/src/index.ts:392:23)
https://webpack.js.org/configuration/configuration-languages/#typescript