gritcode / gritcode-components

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

'import' and 'export' may appear only with 'sourceType: module' #2

Closed kylekz closed 8 years ago

kylekz commented 8 years ago

I'm using Laravel Elixir with Vueify, which defaults to es2015 syntax. My existing ES6 code compiles just fine, but as soon as I import the toast module from source using npm, I'm getting

[03:41:08] gulp-notify: [Laravel Elixir] Browserify Failed!: 'import' and 'export' may appear only with 'sourceType: module'

/home/vagrant/Projects/ReflexEngine/node_modules/gritcode-components/src/components/toast/index.js:2
import './toast.scss'
^
ParseError: 'import' and 'export' may appear only with 'sourceType: module'

Am I doing something wrong or is this an actual issue?

kzima commented 8 years ago

@xKairu I can see that you are using browserfy. You need to use webpack for this components to work. Componets are compiled with special theme-loader that only work in webpack. Please see https://github.com/kzima/vuestrap-starter for sample configuration.