Aurelia-bootstrapper cannot resolve typescript shared library

I moved some code of Aurelia/Typescript services to a shared library and added it to the tsconfig.json

"paths": {
            "base-lib/*": ["../../base-lib/*"]
  }

The IDE (IntelliJ) is able to find and resolve the library in main.ts.

import {DurationFormatValueConverter} from 'base-lib/model-value-converters'

But Webpack/Aurelia not. When I try to run an build command, it fails with:

ERROR in ./src/main.ts
Module not found: Error: Can't resolve 'base-lib/model-value-converters' in 'C:\Users\xxx\myProject\src'
 @ ./src/main.ts
 @ ./node_modules/aurelia-webpack-plugin/runtime/empty-entry.js
 @ multi aurelia-webpack-plugin/runtime/empty-entry aurelia-webpack-plugin/runtime/pal-loader-entry aurelia-bootstrapper

I dont want to add the library via npm install ../lib because this has side-effects with webpack optimization I want to prevent.

1 Like

I found the problem and solution here: https://github.com/aurelia/webpack-plugin/wiki/Debugging-missing-modules

1 Like

Glad that you found it :+1: