├── .gitignore ├── LICENSE ├── README.md ├── index.js └── package.json /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2016 Koala 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # fis3-parser-vue 2 | fis3 parser vue 3 | -------------------------------------------------------------------------------- /index.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | var compiler = require('vueify-sync').compiler; 4 | 5 | module.exports = function (content, file, conf) { 6 | var result = ''; 7 | // 用 HTML 相关语言能力处理一遍 8 | if (fis.compile.partial && file.ext === '.vue') { 9 | content = fis.compile.partial(content, file, { 10 | ext: '.html', 11 | isHtmlLike: true 12 | }); 13 | } 14 | try { 15 | result = compiler.compileSync(content.toString('utf8'), file.realpath); 16 | } catch (e) { 17 | console.log(e.stack); 18 | } 19 | return result; 20 | }; 21 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "fis3-parser-vue", 3 | "version": "0.3.0", 4 | "description": "fis3 parser vue", 5 | "main": "index.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "repository": { 10 | "type": "git", 11 | "url": "git+https://github.com/okoala/fis3-parser-vue.git" 12 | }, 13 | "keywords": [ 14 | "fis3", 15 | "parser", 16 | "vue" 17 | ], 18 | "author": "Koala Huang ", 19 | "license": "MIT", 20 | "bugs": { 21 | "url": "https://github.com/okoala/fis3-parser-vue/issues" 22 | }, 23 | "homepage": "https://github.com/okoala/fis3-parser-vue#readme", 24 | "dependencies": { 25 | "vueify-sync": "^0.2.0" 26 | }, 27 | "devDependencies": { 28 | "babel-core": "^6.4.0", 29 | "babel-plugin-transform-runtime": "^6.4.3", 30 | "babel-preset-es2015": "^6.3.13", 31 | "babel-runtime": "^5.8.34", 32 | "vue-hot-reload-api": "^1.2.2", 33 | "vueify-insert-css": "^1.0.0" 34 | } 35 | } 36 | --------------------------------------------------------------------------------