My current challenge involves the task of finding a way to publish our team's component library. These components are intended to be used by various internal applications within our organization. I have specific requirements:
- The library must be accessible as an npm package from an internal local repository (this part has been resolved).
- Components need to be compiled into JavaScript with typescript interface (*.d.ts) references included in the package.
- Avoid bundling third-party packages (including Vue). Instead, it is preferred that the necessary dependencies be added to a project when the component is introduced and after running "npm i".
- The compiled css bundle should be part of the package but referenced separately within a project as needed.
- The raw scss files used for styling components should also be included in the package so they can be integrated into a project's existing scss during the build process.
I have explored using
vue-cli-service build --target lib
to achieve these goals, but it appears to bundle everything together.
Is what I'm aiming for feasible? Could it potentially be considered an anti-pattern? Are there any alternative solutions available? I am unsure of where to start.