yuche / vue-strap

Bootstrap components built with Vue.js
http://yuche.github.io/vue-strap/
MIT License
4.71k stars 932 forks source link

Unexpected token export in EventListener.js #209

Open ghost opened 8 years ago

ghost commented 8 years ago

Hi all, i am using webpack with vue and imported Carousel in Component like

    import carousel     from 'vue-strap/src/Carousel.vue';
    import slider       from 'vue-strap/src/Slider.vue';
module.exports = {
    entry: ['./src/index.js', './src/auth/index.js'],
    output: {
        path: __dirname + '/build/',
        publicPath: 'build/',
        filename: 'build.js'
    },
    module: {
        loaders: [
            {test: /\.vue$/, loader: 'vue'},
            {
                test: /\.js$/, loader: 'babel', exclude: /node_modules/
            }
        ]
    },
    babel: {
        presets: ['es2015'],
        plugins: ['transform-runtime']
    },
    vue: {
        loaders: {
            js: 'babel'
        }
    }
}

then i run webpack and have error in subject on chrome developer tools. what i do wrong?

webpack version 1.13 vue version 1.0.24

doonetheprune commented 8 years ago

I would suggest you replace your imports with

import {carousel, slider} from 'vue-strap';

ghost commented 8 years ago

So that is cool, but i need edit files Carousel.vue and Slider.vue, and not need use precompiled version of code.

So problem in webpack - its exclude babel transpiller from node_modules. I copied files EventEmitter and coerceBoolean.js with Carousel and Slide components to project folder and deleted vue-strap from dependency.