vuejs / vueify

Browserify transform for single-file Vue components
MIT License
1.17k stars 152 forks source link

Cannot find module './vue-img-upload.vue' vue-img-upload/dist #185

Open sombriks opened 7 years ago

sombriks commented 7 years ago

Hello all,

i have a small project still under development but i got a situation that may be a problem in the future.

In the docs, when using my compoment like this i got no errors and it gets rendered correctly:

const Vue = require("vue")
// const VueImgUpload = require("../dist/build")
const VueImgUpload = require("../src/main")
Vue.use(VueImgUpload)

require("../node_modules/flexboxgrid/css/flexboxgrid.css")

new Vue({
  el: "#mountpoint",
  render: (f) => f(require("./docs.vue"))
})

however, if i try to consume the dist/build version it gives me the following error:

image

i am worried since my lib will offer the dist/build.js as output. in previous situations, i used a workaround by simply doing require directly to the componente, although i don't think it's the recommended way.

any guidance is welcome.

the project uses browserify to bundle things.