I am creating a vuejs plugin. I haven't published it to NPM yet, because I need to test it extensively, the problem I have is, if I push my code to github then NPM, I could simple install the plugin using
npm install foobar
Then I could use it in my app like this.
import foobar from 'foobar'
and the usuall <foobar> .. </foobar>
This way, it works, I can actually test it, how do I test the app while I am developing instead of pushing to NPM, Github then updating my dependency every minute?
I know there is a simple way but I can't find out what is it
In the file heirarchy you can see below, I have tried importing the dist/foobar.js as
inside the index.html but it just won't work.
This is my apps structure.
my-plugin
dist
foobar.js
node_modules
src
components
foobar.vue
index.html
index.js
foobar.vue is the actual app whereas the index.js simply imports foobar and exports it as:
import foobar from './components/foobar.vue'
export {foobar}
The app has no errors or issue, it works. But to test if foobar is working, I have to push it to github and npm and then I have to install it to use it.
npm run serve
lauches the app at localhost:8080 in development mode and shows me the contents of index.html but in this file if I require dist/foobar.js it won't work, for example <foobar></foobar>
has no effect