Import won't work in modular env
pongoman opened this issue · comments
When I am following your example and do in app.vue import Simplert from './simplert.vue'
I get:
This dependency was not found in node_modules:
- ./simplert.vue
Did you forget to run npm install --save for it?
However, if I try import Simplert from 'vue2-simplert/dist/vue2-simplert.js'
it will work but it seems I cannot get the modal to appear.
Project created with vue-cli wepback template
Thanks.
Thanks for your report.
For import Simplert from './simplert.vue'
yes it will not work beacause .
is relative with your root project.
I will update documentation.
For not showing modal, let me try to reproduce this issue first.
Thanks
Do you have try to import from src
folder @pongoman ?
Like this ?
import Simplert from 'vue2-simplert/src/app/simplert.vue'
Just to mention, the way I described above does not produce any errors and watching through devtools the props of the component would not update. Note that it should be :simplertData="simplertData"
.
Yes I did try that doesn't work either, for some reason I get this result:
ERROR Failed to compile with 1 errors
This dependency was not found in node_modules:
* !!vue-style-loader!css-loader!vue-loader/lib/style-rewriter?id=data-v-326da139&scoped=true!sass-loader!vue-loader/lib/selector?type=styles&index=0!./simplert.vue
vue-loader and other packages are installed, project was created throught vue-cli
Maybe you should update package.json to point to the file you would like to.
Cheers
I have testing and update the documentation for using in another project,
Hope can help you, please check README.md