I'd like to extend the default webpack config of ionic. Specifically, I'd like to add an alias for resolving modules so that I can import modules by their absolute path, rather than a relative one:
Instead of importing modules like this:
import { SomeComponent } from '../../components/some.component.ts';
I want to
import { SomeComponent } from '@app/components/some.component.ts';
where @app
is an alias for the root source directory.
In other projects I was able to do this by adding something like this to the webpack config:
module.exports = {
...
resolve: {
extensions: ['.ts', '.js'],
alias: {
'@app': path.resolve('./'),
}
},
...
};
I'm not sure how to do this with Ionic without overriding the default webpack config.