first commit
This commit is contained in:
9
app_vue/node_modules/vue-template-es2015-compiler/README.md
generated
vendored
Normal file
9
app_vue/node_modules/vue-template-es2015-compiler/README.md
generated
vendored
Normal 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
app_vue/node_modules/vue-template-es2015-compiler/buble.js
generated
vendored
Normal file
16857
app_vue/node_modules/vue-template-es2015-compiler/buble.js
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
26
app_vue/node_modules/vue-template-es2015-compiler/index.js
generated
vendored
Normal file
26
app_vue/node_modules/vue-template-es2015-compiler/index.js
generated
vendored
Normal 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
|
||||
}
|
32
app_vue/node_modules/vue-template-es2015-compiler/package.json
generated
vendored
Normal file
32
app_vue/node_modules/vue-template-es2015-compiler/package.json
generated
vendored
Normal file
@ -0,0 +1,32 @@
|
||||
{
|
||||
"name": "vue-template-es2015-compiler",
|
||||
"version": "1.9.1",
|
||||
"description": "Post compiler for Vue template render functions to support ES2015+ features",
|
||||
"main": "index.js",
|
||||
"author": "Evan You",
|
||||
"license": "MIT",
|
||||
"files": [
|
||||
"index.js",
|
||||
"buble.js"
|
||||
],
|
||||
"scripts": {
|
||||
"build": "cd buble && npm run build && cp dist/buble-browser-deps.umd.js ../buble.js",
|
||||
"test": "jest",
|
||||
"prepublishOnly": "jest && npm run build"
|
||||
},
|
||||
"devDependencies": {
|
||||
"jest": "^24.1.0",
|
||||
"vue": "^2.6.0",
|
||||
"vue-template-compiler": "^2.6.0"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/vuejs/vue-template-es2015-compiler"
|
||||
},
|
||||
"jest": {
|
||||
"testPathIgnorePatterns": [
|
||||
"/node_modules/",
|
||||
"/buble/"
|
||||
]
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user