This repository was archived by the owner on Jan 18, 2022. It is now read-only.
File tree Expand file tree Collapse file tree 7 files changed +27
-74
lines changed Expand file tree Collapse file tree 7 files changed +27
-74
lines changed Original file line number Diff line number Diff line change @@ -107,6 +107,8 @@ var babel$1 = {
107107
108108var compilers = { babel : babel$1 } ;
109109
110+ require ( 'es6-promise' ) . polyfill ( ) ;
111+
110112/**
111113 * Ensure there's only one template node.
112114 *
@@ -130,6 +132,7 @@ function validateNodeCount(fragment) {
130132 * @returns {DocumentFragment }
131133 */
132134function parseContent ( content ) {
135+ // noinspection JSValidateTypes
133136 return parse5 . parseFragment ( content , { locationInfo : true } ) ;
134137}
135138
@@ -230,7 +233,7 @@ var Compiler = function () {
230233 } , {
231234 key : 'checkSrc' ,
232235 value : function checkSrc ( node , filePath ) {
233- // TODO: Up next.
236+ // TODO: Up next. ${node}, ${filePath}
234237 return null ;
235238 }
236239 /**
Original file line number Diff line number Diff line change 2424 },
2525 "homepage" : " https://github.com/znck/rollup-plugin-vue#readme" ,
2626 "dependencies" : {
27- "parse5" : " latest" ,
28- "lru-cache" : " latest" ,
29- "rollup-pluginutils" : " latest" ,
30- "promise" : " latest" ,
31- "postcss" : " latest" ,
32- "object-assign" : " latest" ,
33- "postcss-selector-parser" : " latest" ,
3427 "autoprefixer" : " latest" ,
35- "cssnano" : " latest" ,
36- "hash-sum" : " latest" ,
37- "vue-template-validator" : " latest" ,
28+ "babel-core" : " latest" ,
29+ "babel-preset-es2015-rollup" : " ^1.1.1" ,
3830 "chalk" : " latest" ,
31+ "cssnano" : " latest" ,
3932 "de-indent" : " latest" ,
33+ "es6-promise" : " ^3.1.2" ,
34+ "hash-sum" : " latest" ,
4035 "html-minifier" : " latest" ,
36+ "lru-cache" : " latest" ,
37+ "object-assign" : " latest" ,
38+ "parse5" : " latest" ,
39+ "postcss" : " latest" ,
40+ "postcss-selector-parser" : " latest" ,
41+ "promise" : " latest" ,
4142 "rollup-plugin-babel" : " latest" ,
42- "babel-core" : " latest"
43+ "rollup-pluginutils" : " latest" ,
44+ "vue-template-validator" : " latest"
4345 },
4446 "devDependencies" : {
4547 "coveralls" : " ^2.11.6" ,
4850 "mocha" : " ^2.3.4" ,
4951 "mocha-lcov-reporter" : " ^1.0.0" ,
5052 "vue-hot-reload-api" : " ^1.2.2" ,
51- "rollup" : " latest"
53+ "rollup" : " latest" ,
54+ "rollup-plugin-replace" : " latest"
5255 }
5356}
Original file line number Diff line number Diff line change @@ -7,6 +7,8 @@ import chalk from 'chalk'
77import compilers from './compilers/index'
88import options from './options'
99
10+ require ( 'es6-promise' ) . polyfill ( )
11+
1012/**
1113 * Ensure there's only one template node.
1214 *
@@ -30,6 +32,7 @@ function validateNodeCount (fragment) {
3032 * @returns {DocumentFragment }
3133 */
3234function parseContent ( content ) {
35+ // noinspection JSValidateTypes
3336 return parse5 . parseFragment ( content , { locationInfo : true } )
3437}
3538
@@ -51,23 +54,6 @@ function checkLang (node) {
5154 }
5255}
5356
54- /**
55- * Extract parts from resolved array.
56- *
57- * @param {Array } parts
58- * @param {String } type
59- */
60- function extract ( parts , type ) {
61- return parts
62- . filter ( function ( part ) {
63- return part . type === type
64- } )
65- . map ( function ( part ) {
66- return part . code
67- } )
68- . join ( '\n' )
69- }
70-
7157function padContent ( content ) {
7258 return content
7359 . split ( / \r ? \n / g)
@@ -115,7 +101,7 @@ export default class Compiler {
115101 * @return {String }
116102 */
117103 checkSrc ( node , filePath ) {
118- // TODO: Up next.
104+ // TODO: Up next. ${node}, ${filePath}
119105 return null
120106 }
121107 /**
Original file line number Diff line number Diff line change 1- var Test = function ( ) {
2- function Test ( ) {
3- babelHelpers . classCallCheck ( this , Test ) ;
4- }
5-
6- babelHelpers . createClass ( Test , [ {
7- key : "ok" ,
8- value : function ok ( ) { }
9- } ] ) ;
10- return Test ;
11- } ( ) ;
12-
131var evens = [ 2 , 4 , 6 , 8 ] ;
142var odds = evens . map ( function ( v ) {
153 return v + 1 ;
Load Diff This file was deleted.
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 11/* global describe, it */
2- var vuePlugin = require ( '..' )
2+ var vuePlugin = require ( '../ ' )
33var assert = require ( 'assert' )
44var fs = require ( 'fs' )
5- var rollup = require ( 'rollup' ) . rollup
5+ var rollup = require ( 'rollup' )
66var path = require ( 'path' )
77
88process . chdir ( __dirname )
@@ -16,14 +16,14 @@ function test (name) {
1616
1717 var entry = './fixtures/' + name + '.vue'
1818 var expected = read ( 'expects/' + name + '.js' )
19- return rollup ( {
19+ return rollup . rollup ( {
20+ format : 'cjs' ,
2021 entry : entry ,
2122 plugins : [ vuePlugin ( ) ]
2223 } ) . then ( function ( bundle ) {
2324 var result = bundle . generate ( )
2425 var code = result . code
2526 assert . equal ( code , expected , 'should compile correctly' )
26- return result
2727 } ) . catch ( function ( error ) {
2828 throw error
2929 } )
You can’t perform that action at this time.
0 commit comments