I have 2 typescript projects which contain few classes. I have added Project1's dependency in the Project2 in package.json
{
"name": "Project2",
"dependencies": {
"@Project1": "file:../Project1/dist"
}
}
Both the project are built using
"target": "es5", "module": "es2015",
I am using Karma-Webpack for setting up test environment for the projects. To transpile the code I have used babel-loader (with preset: es2015) instead of ts-loader. It transpiles the code from the Project2 but the code from Project1 located in node_modules is not getting transpiled. Due to that it throws below error when the test is run
Chrome 55.0.2883 (Windows 10 0.0.0) ERROR Uncaught SyntaxError: Unexpected token export at spec.bundle.js:80972
I was wondering is it possible to transpile local modules from node_modules using webpack?
Note: if I change the module type to "commonjs", it works but this not the solution I am looking for.
Any suggestions???