Vuegister plugin for Babel.
Issues with the output should be reported on the Babel issue tracker.
Install
npm i vuegister-plugin-babel -D
Test suite example
To run test suite create test.js
and MyComponent.vue
files inside your test
folder.
Content of the test.js
file:
const assert = assert;const Vue = const MyComponent = default
Content of the MyComponent.vue
file:
{{ message }}
Install jsdom-global and run tests with:
npm i jsdom jsdom-global -Dmocha -r jsdom-global/register -r vuegister/register
Caveats
Babel transpiles this code:
{ return message: 'hello!' }
into this:
Object;exportsdefault = { return message: 'hello!' ; };
So now you have to call .default
in Node.js code:
var foo = default
Tests
To run the test suite, install development dependencies and execute:
npm run coverage
License
Distributed under MIT License.