node_modules

This commit is contained in:
saeid
2019-07-15 13:07:31 +04:30
parent d3735c6d30
commit ce1a3ebf9c
35713 changed files with 3639219 additions and 1 deletions
+21
View 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.
+39
View File
@@ -0,0 +1,39 @@
# @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-loader](https://github.com/webpack-contrib/cache-loader) 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`.
## Installing in an Already Created Project
``` sh
vue add @vue/babel
```
## Injected webpack-chain Rules
- `config.rule('js')`
- `config.rule('js').use('babel-loader')`
- `config.rule('js').use('cache-loader')`
+16
View File
@@ -0,0 +1,16 @@
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/app']
},
dependencies: {
'core-js': '^2.6.5'
}
})
}
+71
View File
@@ -0,0 +1,71 @@
const path = require('path')
const { isWindows } = require('@vue/cli-shared-utils')
function genTranspileDepRegex (transpileDependencies) {
const deps = transpileDependencies.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
}
})
return deps.length ? new RegExp(deps.join('|')) : null
}
module.exports = (api, options) => {
const useThreads = process.env.NODE_ENV === 'production' && options.parallel
const cliServicePath = require('path').dirname(require.resolve('@vue/cli-service'))
const transpileDepRegex = genTranspileDepRegex(options.transpileDependencies)
api.chainWebpack(webpackConfig => {
webpackConfig.resolveLoader.modules.prepend(path.join(__dirname, 'node_modules'))
const jsRule = webpackConfig.module
.rule('js')
.test(/\.m?jsx?$/)
.exclude
.add(filepath => {
// always transpile js in vue files
if (/\.vue\.jsx?$/.test(filepath)) {
return false
}
// exclude dynamic entries from cli-service
if (filepath.startsWith(cliServicePath)) {
return true
}
// check if this is something the user explicitly wants to transpile
if (transpileDepRegex && transpileDepRegex.test(filepath)) {
return false
}
// Don't transpile node_modules
return /node_modules/.test(filepath)
})
.end()
.use('cache-loader')
.loader('cache-loader')
.options(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'
]))
.end()
if (useThreads) {
jsRule
.use('thread-loader')
.loader('thread-loader')
}
jsRule
.use('babel-loader')
.loader('babel-loader')
})
}
BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 707 B

+65
View File
@@ -0,0 +1,65 @@
{
"_args": [
[
"@vue/cli-plugin-babel@3.5.5",
"D:\\Atom\\Git\\Laravel_CSSD"
]
],
"_development": true,
"_from": "@vue/cli-plugin-babel@3.5.5",
"_id": "@vue/cli-plugin-babel@3.5.5",
"_inBundle": false,
"_integrity": "sha512-ew+EWL2ur234wqQfI1AvWcghjWQ2PlSVpUAfnDlejplDzXSHz7455IIwN7Auhs7siEbls3EVd/bl/ieKGjwY5g==",
"_location": "/@vue/cli-plugin-babel",
"_phantomChildren": {},
"_requested": {
"type": "version",
"registry": true,
"raw": "@vue/cli-plugin-babel@3.5.5",
"name": "@vue/cli-plugin-babel",
"escapedName": "@vue%2fcli-plugin-babel",
"scope": "@vue",
"rawSpec": "3.5.5",
"saveSpec": null,
"fetchSpec": "3.5.5"
},
"_requiredBy": [
"#DEV:/"
],
"_resolved": "https://registry.npmjs.org/@vue/cli-plugin-babel/-/cli-plugin-babel-3.5.5.tgz",
"_spec": "3.5.5",
"_where": "D:\\Atom\\Git\\Laravel_CSSD",
"author": {
"name": "Evan You"
},
"bugs": {
"url": "https://github.com/vuejs/vue-cli/issues"
},
"dependencies": {
"@babel/core": "^7.0.0",
"@vue/babel-preset-app": "^3.5.5",
"@vue/cli-shared-utils": "^3.5.1",
"babel-loader": "^8.0.5",
"webpack": ">=4 < 4.29"
},
"description": "babel plugin for vue-cli",
"gitHead": "22acaf6498750f8a69ab54ccf51fa92ebe54f9d7",
"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",
"publishConfig": {
"access": "public"
},
"repository": {
"type": "git",
"url": "git+https://github.com/vuejs/vue-cli.git",
"directory": "packages/@vue/cli-plugin-babel"
},
"version": "3.5.5"
}