This commit is contained in:
darenhsu
2022-07-17 13:16:16 +08:00
parent 84759556ff
commit befd344ab0
28070 changed files with 4008428 additions and 1 deletions
+9
View File
@@ -0,0 +1,9 @@
This is an internal package used by `vue-loader` and `vueify`. It processes the raw render functions generated by `vue-template-compiler` to:
1. add support to ES2015 features in template expressions via Buble. (see [supported features here](https://buble.surge.sh/guide/#supported-features)).
**Note:** since version 1.8.0, object rest spread usage inside templates are transpiled to `Object.assign` calls by default. This means if you need to support IE, you will need to polyfill `Object.assign`. (Latest version of Vue CLI will do this for you).
2. remove the `with` block inside render functions to make it strict-mode compliant. This is performed only at build time so that the base template compiler can be extremely small and lightweight.
The buble implementation is built from a fork at https://github.com/yyx990803/buble
+16857
View File
File diff suppressed because one or more lines are too long
+26
View File
@@ -0,0 +1,26 @@
var buble = require('./buble.js')
// selectively support some handy ES2015 features in templates.
var defaultOptions = {
transforms: {
modules: false,
// this is a custom feature for stripping with from Vue render functions.
stripWith: true,
// custom feature ensures with context targets functional render
stripWithFunctional: false
},
// allow spread...
objectAssign: 'Object.assign'
}
module.exports = function transpile (code, opts) {
if (opts) {
opts = Object.assign({}, defaultOptions, opts)
opts.transforms = Object.assign({}, defaultOptions.transforms, opts.transforms)
} else {
opts = defaultOptions
}
var code = buble.transform(code, opts).code
// console.log(code)
return code
}
+66
View File
@@ -0,0 +1,66 @@
{
"_args": [
[
"vue-template-es2015-compiler@1.9.1",
"/mnt/Foxconn/Digitalent/Deverloper/liff-push_2series"
]
],
"_from": "vue-template-es2015-compiler@1.9.1",
"_id": "vue-template-es2015-compiler@1.9.1",
"_inBundle": false,
"_integrity": "sha512-4gDntzrifFnCEvyoO8PqyJDmguXgVPxKiIxrBKjIowvL9l+N66196+72XVYR8BBf1Uv1Fgt3bGevJ+sEmxfZzw==",
"_location": "/vue-template-es2015-compiler",
"_phantomChildren": {},
"_requested": {
"type": "version",
"registry": true,
"raw": "vue-template-es2015-compiler@1.9.1",
"name": "vue-template-es2015-compiler",
"escapedName": "vue-template-es2015-compiler",
"rawSpec": "1.9.1",
"saveSpec": null,
"fetchSpec": "1.9.1"
},
"_requiredBy": [
"/@vue/component-compiler-utils"
],
"_resolved": "https://registry.npmjs.org/vue-template-es2015-compiler/-/vue-template-es2015-compiler-1.9.1.tgz",
"_spec": "1.9.1",
"_where": "/mnt/Foxconn/Digitalent/Deverloper/liff-push_2series",
"author": {
"name": "Evan You"
},
"bugs": {
"url": "https://github.com/vuejs/vue-template-es2015-compiler/issues"
},
"description": "Post compiler for Vue template render functions to support ES2015+ features",
"devDependencies": {
"jest": "^24.1.0",
"vue": "^2.6.0",
"vue-template-compiler": "^2.6.0"
},
"files": [
"index.js",
"buble.js"
],
"homepage": "https://github.com/vuejs/vue-template-es2015-compiler#readme",
"jest": {
"testPathIgnorePatterns": [
"/node_modules/",
"/buble/"
]
},
"license": "MIT",
"main": "index.js",
"name": "vue-template-es2015-compiler",
"repository": {
"type": "git",
"url": "git+https://github.com/vuejs/vue-template-es2015-compiler.git"
},
"scripts": {
"build": "cd buble && npm run build && cp dist/buble-browser-deps.umd.js ../buble.js",
"prepublishOnly": "jest && npm run build",
"test": "jest"
},
"version": "1.9.1"
}