gritcode / gritcode-components

Custom components based on Vuestrap.
http://gritcode.github.io/gritcode-components/#/toast
MIT License
204 stars 9 forks source link

Browserify support? #5

Open fractaledmind opened 8 years ago

fractaledmind commented 8 years ago

This library currently only works with Webpack and not Browserify. Would it be possible to add support for Browserify?

FWIW, I get this error when I try to include a component like so import toast from 'gritcode-components/src/components/toast

ParseError: 'import' and 'export' may appear only with 'sourceType: module'

This error is due to the library's package.json not containing a "browserify" command.

For comparison, this is the VueStrap package.json, which does have browserify support: https://github.com/yuche/vue-strap/blob/master/package.json

kzima commented 8 years ago

Hey @smargh, browserfiy support is on my todo list :)

phuclh commented 8 years ago

I have the same problem? Do you have any idea to fix that?

kzima commented 8 years ago

@phuclh I am working on a new version of components, so I will let you know as soon as it is ready. I should have it done by the end of this month.

phuclh commented 8 years ago

@kzima Thank you :D

dydx commented 8 years ago

Man, this would be nice. Laravel's Elixir uses Browserify, and I'd really like to be able to use this with some Laravel projects without having to call in Webpack. Very nice stuff, regardless of that, though.

loranger commented 8 years ago

Even with laravel elixir, webpack and babel-loader, I'm not able to use gritcode-components ($export is not a function)... The perfect solution (for us, at least) would be to use the same distribution system as Vue-strap : CommonJS, ES6 and AMD Because gritcode-components is based on vue-strap, that would allow us to use the same workflow as we used with vue-strap.

antongorodezkiy commented 8 years ago

I could load it as const vsFileUpload = require('gritcode-components/dist/gritcode-components').fileUpload; to avoid the error

Browserify Failed!: 'import' and 'export' may appear only with 'sourceType: module'