DRY, configure path aliases only once and in the right place.
Never heard of path aliases? One of many articles on how it makes our life easier https://netbasal.com/sexier-imports-in-typescript-e3c645bdd3c6
You are tired of duplicating code when you need to add a new path alias (alias
section in webpack config and paths
section in tsconfig.json).
Now you can add it only to tsconfig.json and no longer worry about the rest
If yon don't have a project, you can create TypeScript project using vue cli:
vue create my-vue-lib
Or use preset vatson/vue-ts-lib
that includes ts-paths and ts-bundler plugins to speed up the development of any components library
More information you can find here https://github.com/vatson/vue-ts-lib
Install the plugin into your project:
cd my-vue-app
vue add ts-paths
That's it. You do not have to do anything else. Just add new aliases to tsconfig.json
.
MIT