I'm using vue-cli for build my lib with this command:
"build": "vue-cli-service build --target lib --name myLib ./src/component.vue"
How can I import my component from the dist folder after the build?
If I import from path-to-myLib/src/component.vue
, everything is fine! But the code below does not work:
// undefined
import { component } from 'path-to-myLib/dist/myLib.umd.js'
// undefined
import myComponent'path-to-myLib/dist/myLib.umd.js'
// result: https://i.stack.imgur.com/xHSzL.png
import * as myComponent'path-to-myLib/dist/myLib.umd.js'
I cannot understand what the problem is.
export { foobar }
– samayocomponent.vue
like in this example github.com/samayo/vuejs-hello-app/blob/master/src/components/…. If not check my previous link or the github code, the SO link shows step-by-step process on how to make the lib and the github code shows the finished product. You can mirror-check your code to see what is missing – samayo