fgnass / spin.js

A spinning activity indicator
http://spin.js.org
MIT License
9.3k stars 1.02k forks source link

Can not build with babelify #358

Open heggi opened 6 years ago

heggi commented 6 years ago

main.js only import module

import { Spinner } from 'spin.js';

package.json

{
    "dependencies": {
        "babel-core": "^6.26.0",
        "babel-preset-es2015": "^6.24.1",
        "babelify": "^8.0.0",
        "browserify": "^16.2.0",
        "spin.js": "^3.1.0"
    },
    "browserify": {
        "transform": [
            [
                "babelify", {
                    "presets": [
                        "es2015"
                    ]
                }
            ]
        ]
    }
}

run browserify src/assets/js/main.js -o public/js/main.js

got error:

/home/heggi/git/portal/node_modules/spin.js/spin.js:114
export { Spinner };
^
ParseError: 'import' and 'export' may appear only with 'sourceType: module'

If I writing own simple module, import it and try build it, all work fine.