first
This commit is contained in:
21
node_modules/@vue/cli-plugin-babel/LICENSE
generated
vendored
Normal file
21
node_modules/@vue/cli-plugin-babel/LICENSE
generated
vendored
Normal file
@ -0,0 +1,21 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2017-present, Yuxi (Evan) You
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
40
node_modules/@vue/cli-plugin-babel/README.md
generated
vendored
Normal file
40
node_modules/@vue/cli-plugin-babel/README.md
generated
vendored
Normal file
@ -0,0 +1,40 @@
|
||||
# @vue/cli-plugin-babel
|
||||
|
||||
> babel plugin for vue-cli
|
||||
|
||||
## Configuration
|
||||
|
||||
Uses Babel 7 + `babel-loader` + [@vue/babel-preset-app](https://github.com/vuejs/vue-cli/tree/dev/packages/%40vue/babel-preset-app) by default, but can be configured via `babel.config.js` to use any other Babel presets or plugins.
|
||||
|
||||
By default, `babel-loader` excludes files inside `node_modules` dependencies. If you wish to explicitly transpile a dependency module, you will need to add it to the `transpileDependencies` option in `vue.config.js`:
|
||||
|
||||
``` js
|
||||
module.exports = {
|
||||
transpileDependencies: [
|
||||
// can be string or regex
|
||||
'my-dep',
|
||||
/other-dep/
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
## Caching
|
||||
|
||||
Cache options of [babel-loader](https://github.com/babel/babel-loader#options) is enabled by default and cache is stored in `<projectRoot>/node_modules/.cache/babel-loader`.
|
||||
|
||||
## Parallelization
|
||||
|
||||
[thread-loader](https://github.com/webpack-contrib/thread-loader) is enabled by default when the machine has more than 1 CPU cores. This can be turned off by setting `parallel: false` in `vue.config.js`.
|
||||
|
||||
`parallel` should be set to `false` when using Babel in combination with non-serializable loader options, such as regexes, dates and functions. These options would not be passed correctly to `babel-loader` which may lead to unexpected errors.
|
||||
|
||||
## Installing in an Already Created Project
|
||||
|
||||
```bash
|
||||
vue add babel
|
||||
```
|
||||
|
||||
## Injected webpack-chain Rules
|
||||
|
||||
- `config.rule('js')`
|
||||
- `config.rule('js').use('babel-loader')`
|
41
node_modules/@vue/cli-plugin-babel/codemods/usePluginPreset.js
generated
vendored
Normal file
41
node_modules/@vue/cli-plugin-babel/codemods/usePluginPreset.js
generated
vendored
Normal file
@ -0,0 +1,41 @@
|
||||
module.exports = function (fileInfo, api) {
|
||||
const j = api.jscodeshift
|
||||
const root = j(fileInfo.source)
|
||||
|
||||
const useDoubleQuote = root.find(j.Literal).some(({ node }) => node.raw.startsWith('"'))
|
||||
|
||||
root
|
||||
.find(j.Literal, { value: '@vue/app' })
|
||||
.replaceWith(j.stringLiteral('@vue/cli-plugin-babel/preset'))
|
||||
root
|
||||
.find(j.Literal, { value: '@vue/babel-preset-app' })
|
||||
.replaceWith(j.stringLiteral('@vue/cli-plugin-babel/preset'))
|
||||
|
||||
const templateLiterals = root
|
||||
.find(j.TemplateLiteral, {
|
||||
expressions: { length: 0 }
|
||||
})
|
||||
|
||||
templateLiterals
|
||||
.find(j.TemplateElement, {
|
||||
value: {
|
||||
cooked: '@vue/app'
|
||||
}
|
||||
})
|
||||
.closest(j.TemplateLiteral)
|
||||
.replaceWith(j.stringLiteral('@vue/cli-plugin-babel/preset'))
|
||||
|
||||
templateLiterals
|
||||
.find(j.TemplateElement, {
|
||||
value: {
|
||||
cooked: '@vue/babel-preset-app'
|
||||
}
|
||||
})
|
||||
.closest(j.TemplateLiteral)
|
||||
.replaceWith(j.stringLiteral('@vue/cli-plugin-babel/preset'))
|
||||
|
||||
return root.toSource({
|
||||
lineTerminator: '\n',
|
||||
quote: useDoubleQuote ? 'double' : 'single'
|
||||
})
|
||||
}
|
19
node_modules/@vue/cli-plugin-babel/generator.js
generated
vendored
Normal file
19
node_modules/@vue/cli-plugin-babel/generator.js
generated
vendored
Normal file
@ -0,0 +1,19 @@
|
||||
module.exports = api => {
|
||||
// Most likely you want to overwrite the whole config to ensure it's working
|
||||
// without conflicts, e.g. for a project that used Jest without Babel.
|
||||
// It should be rare for the user to have their own special babel config
|
||||
// without using the Babel plugin already.
|
||||
delete api.generator.files['babel.config.js']
|
||||
|
||||
api.extendPackage({
|
||||
babel: {
|
||||
presets: ['@vue/cli-plugin-babel/preset']
|
||||
},
|
||||
vue: {
|
||||
transpileDependencies: true
|
||||
},
|
||||
dependencies: {
|
||||
'core-js': '^3.8.3'
|
||||
}
|
||||
})
|
||||
}
|
125
node_modules/@vue/cli-plugin-babel/index.js
generated
vendored
Normal file
125
node_modules/@vue/cli-plugin-babel/index.js
generated
vendored
Normal file
@ -0,0 +1,125 @@
|
||||
const path = require('path')
|
||||
const babel = require('@babel/core')
|
||||
const { isWindows } = require('@vue/cli-shared-utils')
|
||||
|
||||
function getDepPathRegex (dependencies) {
|
||||
const deps = dependencies.map(dep => {
|
||||
if (typeof dep === 'string') {
|
||||
const depPath = path.join('node_modules', dep, '/')
|
||||
return isWindows
|
||||
? depPath.replace(/\\/g, '\\\\') // double escape for windows style path
|
||||
: depPath
|
||||
} else if (dep instanceof RegExp) {
|
||||
return dep.source
|
||||
}
|
||||
|
||||
throw new Error('transpileDependencies only accepts an array of string or regular expressions')
|
||||
})
|
||||
return deps.length ? new RegExp(deps.join('|')) : null
|
||||
}
|
||||
|
||||
/** @type {import('@vue/cli-service').ServicePlugin} */
|
||||
module.exports = (api, options) => {
|
||||
const useThreads = process.env.NODE_ENV === 'production' && !!options.parallel
|
||||
const cliServicePath = path.dirname(require.resolve('@vue/cli-service'))
|
||||
|
||||
// try to load the project babel config;
|
||||
// if the default preset is used,
|
||||
// there will be a VUE_CLI_TRANSPILE_BABEL_RUNTIME env var set.
|
||||
// the `filename` field is required
|
||||
// in case there're filename-related options like `ignore` in the user config
|
||||
babel.loadPartialConfigSync({ filename: api.resolve('src/main.js') })
|
||||
|
||||
api.chainWebpack(webpackConfig => {
|
||||
webpackConfig.resolveLoader.modules.prepend(path.join(__dirname, 'node_modules'))
|
||||
|
||||
const jsRule = webpackConfig.module
|
||||
.rule('js')
|
||||
.test(/\.m?jsx?$/)
|
||||
.exclude
|
||||
.add(filepath => {
|
||||
const SHOULD_SKIP = true
|
||||
const SHOULD_TRANSPILE = false
|
||||
|
||||
// With data URI support in webpack 5, filepath could be undefined
|
||||
if (!filepath) {
|
||||
return SHOULD_SKIP
|
||||
}
|
||||
|
||||
// Always transpile js in vue files
|
||||
if (/\.vue\.jsx?$/.test(filepath)) {
|
||||
return SHOULD_TRANSPILE
|
||||
}
|
||||
// Exclude dynamic entries from cli-service
|
||||
if (filepath.startsWith(cliServicePath)) {
|
||||
return SHOULD_SKIP
|
||||
}
|
||||
|
||||
// To transpile `@babel/runtime`, the config needs to be
|
||||
// carefully adjusted to avoid infinite loops.
|
||||
// So we only do the tranpilation when the special flag is on.
|
||||
if (getDepPathRegex(['@babel/runtime']).test(filepath)) {
|
||||
return process.env.VUE_CLI_TRANSPILE_BABEL_RUNTIME
|
||||
? SHOULD_TRANSPILE
|
||||
: SHOULD_SKIP
|
||||
}
|
||||
|
||||
// if `transpileDependencies` is set to true, transpile all deps
|
||||
if (options.transpileDependencies === true) {
|
||||
// Some of the deps cannot be transpiled, though
|
||||
// https://stackoverflow.com/a/58517865/2302258
|
||||
const NON_TRANSPILABLE_DEPS = [
|
||||
'core-js',
|
||||
'webpack',
|
||||
'webpack-4',
|
||||
'css-loader',
|
||||
'mini-css-extract-plugin',
|
||||
'promise-polyfill',
|
||||
'html-webpack-plugin',
|
||||
'whatwg-fetch'
|
||||
]
|
||||
const nonTranspilableDepsRegex = getDepPathRegex(NON_TRANSPILABLE_DEPS)
|
||||
return nonTranspilableDepsRegex.test(filepath) ? SHOULD_SKIP : SHOULD_TRANSPILE
|
||||
}
|
||||
|
||||
// Otherwise, check if this is something the user explicitly wants to transpile
|
||||
if (Array.isArray(options.transpileDependencies)) {
|
||||
const transpileDepRegex = getDepPathRegex(options.transpileDependencies)
|
||||
if (transpileDepRegex && transpileDepRegex.test(filepath)) {
|
||||
return SHOULD_TRANSPILE
|
||||
}
|
||||
}
|
||||
|
||||
// Don't transpile node_modules
|
||||
return /node_modules/.test(filepath) ? SHOULD_SKIP : SHOULD_TRANSPILE
|
||||
})
|
||||
.end()
|
||||
|
||||
if (useThreads) {
|
||||
const threadLoaderConfig = jsRule
|
||||
.use('thread-loader')
|
||||
.loader(require.resolve('thread-loader'))
|
||||
|
||||
if (typeof options.parallel === 'number') {
|
||||
threadLoaderConfig.options({ workers: options.parallel })
|
||||
}
|
||||
}
|
||||
|
||||
jsRule
|
||||
.use('babel-loader')
|
||||
.loader(require.resolve('babel-loader'))
|
||||
.options({
|
||||
cacheCompression: false,
|
||||
...api.genCacheConfig('babel-loader', {
|
||||
'@babel/core': require('@babel/core/package.json').version,
|
||||
'@vue/babel-preset-app': require('@vue/babel-preset-app/package.json').version,
|
||||
'babel-loader': require('babel-loader/package.json').version,
|
||||
modern: !!process.env.VUE_CLI_MODERN_BUILD,
|
||||
browserslist: api.service.pkg.browserslist
|
||||
}, [
|
||||
'babel.config.js',
|
||||
'.browserslistrc'
|
||||
])
|
||||
})
|
||||
})
|
||||
}
|
BIN
node_modules/@vue/cli-plugin-babel/logo.png
generated
vendored
Normal file
BIN
node_modules/@vue/cli-plugin-babel/logo.png
generated
vendored
Normal file
Binary file not shown.
After Width: | Height: | Size: 707 B |
24
node_modules/@vue/cli-plugin-babel/migrator/index.js
generated
vendored
Normal file
24
node_modules/@vue/cli-plugin-babel/migrator/index.js
generated
vendored
Normal file
@ -0,0 +1,24 @@
|
||||
const { chalk } = require('@vue/cli-shared-utils')
|
||||
|
||||
module.exports = api => {
|
||||
api.transformScript(
|
||||
'babel.config.js',
|
||||
require('../codemods/usePluginPreset')
|
||||
)
|
||||
|
||||
if (api.fromVersion('^3')) {
|
||||
api.extendPackage(
|
||||
{
|
||||
dependencies: {
|
||||
'core-js': '^3.8.3'
|
||||
}
|
||||
},
|
||||
{ warnIncompatibleVersions: false }
|
||||
)
|
||||
|
||||
// TODO: implement a codemod to migrate polyfills
|
||||
api.exitLog(`core-js has been upgraded from v2 to v3.
|
||||
If you have any custom polyfills defined in ${chalk.yellow('babel.config.js')}, please be aware their names may have been changed.
|
||||
For more complete changelog, see https://github.com/zloirock/core-js/blob/master/CHANGELOG.md#300---20190319`)
|
||||
}
|
||||
}
|
15
node_modules/@vue/cli-plugin-babel/node_modules/.bin/vue-cli-service
generated
vendored
Normal file
15
node_modules/@vue/cli-plugin-babel/node_modules/.bin/vue-cli-service
generated
vendored
Normal file
@ -0,0 +1,15 @@
|
||||
#!/bin/sh
|
||||
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
||||
|
||||
case `uname` in
|
||||
*CYGWIN*) basedir=`cygpath -w "$basedir"`;;
|
||||
esac
|
||||
|
||||
if [ -x "$basedir/node" ]; then
|
||||
"$basedir/node" "$basedir/../../../cli-service/bin/vue-cli-service.js" "$@"
|
||||
ret=$?
|
||||
else
|
||||
node "$basedir/../../../cli-service/bin/vue-cli-service.js" "$@"
|
||||
ret=$?
|
||||
fi
|
||||
exit $ret
|
7
node_modules/@vue/cli-plugin-babel/node_modules/.bin/vue-cli-service.cmd
generated
vendored
Normal file
7
node_modules/@vue/cli-plugin-babel/node_modules/.bin/vue-cli-service.cmd
generated
vendored
Normal file
@ -0,0 +1,7 @@
|
||||
@IF EXIST "%~dp0\node.exe" (
|
||||
"%~dp0\node.exe" "%~dp0\..\..\..\cli-service\bin\vue-cli-service.js" %*
|
||||
) ELSE (
|
||||
@SETLOCAL
|
||||
@SET PATHEXT=%PATHEXT:;.JS;=;%
|
||||
node "%~dp0\..\..\..\cli-service\bin\vue-cli-service.js" %*
|
||||
)
|
15
node_modules/@vue/cli-plugin-babel/node_modules/.bin/webpack
generated
vendored
Normal file
15
node_modules/@vue/cli-plugin-babel/node_modules/.bin/webpack
generated
vendored
Normal file
@ -0,0 +1,15 @@
|
||||
#!/bin/sh
|
||||
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
||||
|
||||
case `uname` in
|
||||
*CYGWIN*) basedir=`cygpath -w "$basedir"`;;
|
||||
esac
|
||||
|
||||
if [ -x "$basedir/node" ]; then
|
||||
"$basedir/node" "$basedir/../../../../webpack/bin/webpack.js" "$@"
|
||||
ret=$?
|
||||
else
|
||||
node "$basedir/../../../../webpack/bin/webpack.js" "$@"
|
||||
ret=$?
|
||||
fi
|
||||
exit $ret
|
7
node_modules/@vue/cli-plugin-babel/node_modules/.bin/webpack.cmd
generated
vendored
Normal file
7
node_modules/@vue/cli-plugin-babel/node_modules/.bin/webpack.cmd
generated
vendored
Normal file
@ -0,0 +1,7 @@
|
||||
@IF EXIST "%~dp0\node.exe" (
|
||||
"%~dp0\node.exe" "%~dp0\..\..\..\..\webpack\bin\webpack.js" %*
|
||||
) ELSE (
|
||||
@SETLOCAL
|
||||
@SET PATHEXT=%PATHEXT:;.JS;=;%
|
||||
node "%~dp0\..\..\..\..\webpack\bin\webpack.js" %*
|
||||
)
|
69
node_modules/@vue/cli-plugin-babel/package.json
generated
vendored
Normal file
69
node_modules/@vue/cli-plugin-babel/package.json
generated
vendored
Normal file
@ -0,0 +1,69 @@
|
||||
{
|
||||
"_from": "@vue/cli-plugin-babel@5.0.8",
|
||||
"_id": "@vue/cli-plugin-babel@5.0.8",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha512-a4qqkml3FAJ3auqB2kN2EMPocb/iu0ykeELwed+9B1c1nQ1HKgslKMHMPavYx3Cd/QAx2mBD4hwKBqZXEI/CsQ==",
|
||||
"_location": "/@vue/cli-plugin-babel",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "version",
|
||||
"registry": true,
|
||||
"raw": "@vue/cli-plugin-babel@5.0.8",
|
||||
"name": "@vue/cli-plugin-babel",
|
||||
"escapedName": "@vue%2fcli-plugin-babel",
|
||||
"scope": "@vue",
|
||||
"rawSpec": "5.0.8",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "5.0.8"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"#DEV:/"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/@vue/cli-plugin-babel/-/cli-plugin-babel-5.0.8.tgz",
|
||||
"_shasum": "54f9a07900f29baff54803dcfa916c602894feb7",
|
||||
"_spec": "@vue/cli-plugin-babel@5.0.8",
|
||||
"_where": "C:\\Users\\zhouxueli\\Desktop\\scheduling-app",
|
||||
"author": {
|
||||
"name": "Evan You"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/vuejs/vue-cli/issues"
|
||||
},
|
||||
"bundleDependencies": false,
|
||||
"dependencies": {
|
||||
"@babel/core": "^7.12.16",
|
||||
"@vue/babel-preset-app": "^5.0.8",
|
||||
"@vue/cli-shared-utils": "^5.0.8",
|
||||
"babel-loader": "^8.2.2",
|
||||
"thread-loader": "^3.0.0",
|
||||
"webpack": "^5.54.0"
|
||||
},
|
||||
"deprecated": false,
|
||||
"description": "babel plugin for vue-cli",
|
||||
"devDependencies": {
|
||||
"@babel/preset-env": "^7.12.16",
|
||||
"jscodeshift": "^0.13.0"
|
||||
},
|
||||
"gitHead": "b154dbd7aca4b4538e6c483b1d4b817499d7b8eb",
|
||||
"homepage": "https://github.com/vuejs/vue-cli/tree/dev/packages/@vue/cli-plugin-babel#readme",
|
||||
"keywords": [
|
||||
"vue",
|
||||
"cli",
|
||||
"babel"
|
||||
],
|
||||
"license": "MIT",
|
||||
"main": "index.js",
|
||||
"name": "@vue/cli-plugin-babel",
|
||||
"peerDependencies": {
|
||||
"@vue/cli-service": "^3.0.0 || ^4.0.0 || ^5.0.0-0"
|
||||
},
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/vuejs/vue-cli.git",
|
||||
"directory": "packages/@vue/cli-plugin-babel"
|
||||
},
|
||||
"version": "5.0.8"
|
||||
}
|
1
node_modules/@vue/cli-plugin-babel/preset.js
generated
vendored
Normal file
1
node_modules/@vue/cli-plugin-babel/preset.js
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
module.exports = require('@vue/babel-preset-app')
|
Reference in New Issue
Block a user