Closed ricardorauber closed 5 years ago
I managed to reduce it to a very simple project, so here it is:
Hi Ricardo !
module-alias
is not designed to be used in combination with webpack - it's for node apps, that run in the backend. So that won't work.
However, you can do what module-alias does in two ways:
tsconfig.json
, you would put something like:{
"compilerOptions": {
"baseUrl": ".",
"paths": {
"core": ["build/core"]
}
}
}
Hope the above helps ; I'll close the issue.
Cheers !
Dear Ricardo, are you requiring module-alias/register.js
somewhere?
If so, rather, hook into module-alias directly, eg.
let moduleAliases = {}
...
const moduleAlias = require('module-alias')
moduleAlias.addAliases(moduleAliases)
Rgds!
Hi, I am having some issues trying to use Webpack with module-alias. My project was developed in TypeScript and the generated code (this part works fine) goes through Webpack and I am having issues trying to run it after Webpack. I will start showing my setup:
package.json
webpack.config.js
The first issue comes when running webpack:
And then when trying to run the final source, I get this:
It seems like module-alias is not being loaded by webpack, because if I try without it, webpack works just fine. The sample code to work with webpack in readme.md is outdated, so I would like to ask if there is anything I should do that I missed or did wrong.
Thanks!