Skip to content
This repository was archived by the owner on Jan 18, 2022. It is now read-only.

Commit d3119a4

Browse files
committed
use vueify compiler
1 parent 2b6df88 commit d3119a4

File tree

2 files changed

+53
-0
lines changed

2 files changed

+53
-0
lines changed

index.js

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
/* globals process */
2+
3+
import {createFilter} from 'rollup-pluginutils';
4+
const {compiler} = require('vueify');
5+
6+
export default vue;
7+
8+
function vue(options = {}) {
9+
let filter = createFilter(options['include'], options['exclude']);
10+
11+
return {
12+
transform(code, id) {
13+
if (!filter(id)) return;
14+
15+
const promise = new Promise(
16+
function (resolve, reject) {
17+
compiler.compile(code, id, function (error, compiled) {
18+
if (error) reject(compiled);
19+
20+
resolve(compiled);
21+
});
22+
}
23+
);
24+
25+
return promise;
26+
}
27+
};
28+
}

package.json

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{
2+
"name": "rollup-plugin-vue",
3+
"version": "1.0.0",
4+
"description": "Roll .vue files",
5+
"main": "index.js",
6+
"scripts": {},
7+
"repository": {
8+
"type": "git",
9+
"url": "git+https://github.com/znck/rollup-plugin-vue.git"
10+
},
11+
"keywords": [
12+
"rollup-plugin",
13+
"vue"
14+
],
15+
"author": "Rahul Kadyan <[email protected]>",
16+
"license": "MIT",
17+
"bugs": {
18+
"url": "https://github.com/znck/rollup-plugin-vue/issues"
19+
},
20+
"homepage": "https://github.com/znck/rollup-plugin-vue#readme",
21+
"dependencies": {
22+
"rollup-pluginutils": "^1.3.1",
23+
"vueify": "^8.3.2"
24+
}
25+
}

0 commit comments

Comments
 (0)