Does not work with npm link #1494
Steps to reproduce
What is expected?
That locally linked npm packeges are working.
What is actually happening?
It throws an error:
Before that it also throws some errors regarding missing eslint packages that are installed in the vue-breakpoints repo but somehow the dependencies are not found.
In packages without named exports it throws
The output in vue-breakpoints is a umd module and should work everywhere. This also only happens with local linked packages. If I install it over npm it works fine. However I am often using
This happens with various packages not only
If you need any more info, let me know
This is not really a Vue CLI issue. In your project you have specified
Put it another way: because your package does not actually have an ESM build, you should not be using
thanks for the fast answer.
However is does not explain why it works if I install the package over npm. It should throw the same error, but then it works fine.
I also tried it with another package vue-observeable where I used rollup and have different builds. Including a commonjs, esm and umd build.
If this is more webpack 4 related I can move the issue over there.
referenced this issue
Oct 29, 2018
Build your npm package project(Let's say A) with
Put this folder under
to import Project A. Then you can test your npm package.
The error message you get is because you are using
I guess the reason is that before you import it, Webpack will compile those files under
When you download it from npm, the files are actually placed under
The explanation I came out is based on what I test with my npm package. I am not sure it's correct, but it will work at the end.