First commit
This commit is contained in:
21
node_modules/@vitejs/plugin-vue2/LICENSE
generated
vendored
Normal file
21
node_modules/@vitejs/plugin-vue2/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2019-present, Yuxi (Evan) You and contributors
|
||||
|
||||
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.
|
||||
129
node_modules/@vitejs/plugin-vue2/README.md
generated
vendored
Normal file
129
node_modules/@vitejs/plugin-vue2/README.md
generated
vendored
Normal file
@@ -0,0 +1,129 @@
|
||||
# @vitejs/plugin-vue2 [](https://npmjs.com/package/@vitejs/plugin-vue2)
|
||||
|
||||
> [!CAUTION]
|
||||
> Vue 2 has reached EOL, and this project is no longer actively maintained.
|
||||
|
||||
---
|
||||
|
||||
> Note: this plugin only works with Vue@^2.7.0.
|
||||
|
||||
```js
|
||||
// vite.config.js
|
||||
import vue from '@vitejs/plugin-vue2'
|
||||
|
||||
export default {
|
||||
plugins: [vue()]
|
||||
}
|
||||
```
|
||||
|
||||
## Options
|
||||
|
||||
```ts
|
||||
export interface Options {
|
||||
include?: string | RegExp | (string | RegExp)[]
|
||||
exclude?: string | RegExp | (string | RegExp)[]
|
||||
|
||||
isProduction?: boolean
|
||||
|
||||
// options to pass on to vue/compiler-sfc
|
||||
script?: Partial<Pick<SFCScriptCompileOptions, 'babelParserPlugins'>>
|
||||
template?: Partial<
|
||||
Pick<
|
||||
SFCTemplateCompileOptions,
|
||||
| 'compiler'
|
||||
| 'compilerOptions'
|
||||
| 'preprocessOptions'
|
||||
| 'transpileOptions'
|
||||
| 'transformAssetUrls'
|
||||
| 'transformAssetUrlsOptions'
|
||||
>
|
||||
>
|
||||
style?: Partial<Pick<SFCStyleCompileOptions, 'trim'>>
|
||||
}
|
||||
```
|
||||
|
||||
## Asset URL handling
|
||||
|
||||
When `@vitejs/plugin-vue2` compiles the `<template>` blocks in SFCs, it also converts any encountered asset URLs into ESM imports.
|
||||
|
||||
For example, the following template snippet:
|
||||
|
||||
```vue
|
||||
<img src="../image.png" />
|
||||
```
|
||||
|
||||
Is the same as:
|
||||
|
||||
```vue
|
||||
<script setup>
|
||||
import _imports_0 from '../image.png'
|
||||
</script>
|
||||
```
|
||||
|
||||
```vue
|
||||
<img :src="_imports_0" />
|
||||
```
|
||||
|
||||
By default the following tag/attribute combinations are transformed, and can be configured using the `template.transformAssetUrls` option.
|
||||
|
||||
```js
|
||||
{
|
||||
video: ['src', 'poster'],
|
||||
source: ['src'],
|
||||
img: ['src'],
|
||||
image: ['xlink:href', 'href'],
|
||||
use: ['xlink:href', 'href']
|
||||
}
|
||||
```
|
||||
|
||||
Note that only attribute values that are static strings are transformed. Otherwise, you'd need to import the asset manually, e.g. `import imgUrl from '../image.png'`.
|
||||
|
||||
## Example for passing options to `vue/compiler-sfc`:
|
||||
|
||||
```ts
|
||||
import vue from '@vitejs/plugin-vue2'
|
||||
|
||||
export default {
|
||||
plugins: [
|
||||
vue({
|
||||
template: {
|
||||
compilerOptions: {
|
||||
// ...
|
||||
},
|
||||
transformAssetUrls: {
|
||||
// ...
|
||||
}
|
||||
}
|
||||
})
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
## Example for transforming custom blocks
|
||||
|
||||
```ts
|
||||
import vue from '@vitejs/plugin-vue2'
|
||||
|
||||
const vueI18nPlugin = {
|
||||
name: 'vue-i18n',
|
||||
transform(code, id) {
|
||||
if (!/vue&type=i18n/.test(id)) {
|
||||
return
|
||||
}
|
||||
if (/\.ya?ml$/.test(id)) {
|
||||
code = JSON.stringify(require('js-yaml').load(code.trim()))
|
||||
}
|
||||
return `export default Comp => {
|
||||
Comp.i18n = ${code}
|
||||
}`
|
||||
}
|
||||
}
|
||||
|
||||
export default {
|
||||
plugins: [vue(), vueI18nPlugin]
|
||||
}
|
||||
```
|
||||
|
||||
## License
|
||||
|
||||
MIT
|
||||
1133
node_modules/@vitejs/plugin-vue2/dist/index.cjs
generated
vendored
Normal file
1133
node_modules/@vitejs/plugin-vue2/dist/index.cjs
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
38
node_modules/@vitejs/plugin-vue2/dist/index.d.ts
generated
vendored
Normal file
38
node_modules/@vitejs/plugin-vue2/dist/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,38 @@
|
||||
import { ViteDevServer, Plugin } from 'vite';
|
||||
import * as _compiler from 'vue/compiler-sfc';
|
||||
import { SFCScriptCompileOptions, SFCTemplateCompileOptions, SFCStyleCompileOptions } from 'vue/compiler-sfc';
|
||||
|
||||
interface VueQuery {
|
||||
vue?: boolean;
|
||||
src?: string;
|
||||
type?: 'script' | 'template' | 'style' | 'custom';
|
||||
index?: number;
|
||||
lang?: string;
|
||||
raw?: boolean;
|
||||
scoped?: boolean;
|
||||
}
|
||||
declare function parseVueRequest(id: string): {
|
||||
filename: string;
|
||||
query: VueQuery;
|
||||
};
|
||||
|
||||
interface Options {
|
||||
include?: string | RegExp | (string | RegExp)[];
|
||||
exclude?: string | RegExp | (string | RegExp)[];
|
||||
isProduction?: boolean;
|
||||
script?: Partial<Pick<SFCScriptCompileOptions, 'babelParserPlugins'>>;
|
||||
template?: Partial<Pick<SFCTemplateCompileOptions, 'compiler' | 'compilerOptions' | 'preprocessOptions' | 'transpileOptions' | 'transformAssetUrls' | 'transformAssetUrlsOptions'>>;
|
||||
style?: Partial<Pick<SFCStyleCompileOptions, 'trim'>>;
|
||||
compiler?: typeof _compiler;
|
||||
}
|
||||
interface ResolvedOptions extends Options {
|
||||
compiler: typeof _compiler;
|
||||
root: string;
|
||||
sourceMap: boolean;
|
||||
cssDevSourcemap: boolean;
|
||||
devServer?: ViteDevServer;
|
||||
devToolsEnabled?: boolean;
|
||||
}
|
||||
declare function vuePlugin(rawOptions?: Options): Plugin;
|
||||
|
||||
export { Options, ResolvedOptions, VueQuery, vuePlugin as default, parseVueRequest };
|
||||
1122
node_modules/@vitejs/plugin-vue2/dist/index.mjs
generated
vendored
Normal file
1122
node_modules/@vitejs/plugin-vue2/dist/index.mjs
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
65
node_modules/@vitejs/plugin-vue2/package.json
generated
vendored
Normal file
65
node_modules/@vitejs/plugin-vue2/package.json
generated
vendored
Normal file
@@ -0,0 +1,65 @@
|
||||
{
|
||||
"name": "@vitejs/plugin-vue2",
|
||||
"version": "2.3.4",
|
||||
"license": "MIT",
|
||||
"author": "Evan You",
|
||||
"packageManager": "pnpm@7.33.5",
|
||||
"files": [
|
||||
"dist"
|
||||
],
|
||||
"main": "./dist/index.cjs",
|
||||
"module": "./dist/index.mjs",
|
||||
"types": "./dist/index.d.ts",
|
||||
"exports": {
|
||||
".": {
|
||||
"types": "./dist/index.d.ts",
|
||||
"import": "./dist/index.mjs",
|
||||
"require": "./dist/index.cjs"
|
||||
}
|
||||
},
|
||||
"engines": {
|
||||
"node": "^14.18.0 || >= 16.0.0"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/vitejs/vite-plugin-vue2.git",
|
||||
"directory": "packages/plugin-vue"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/vitejs/vite-plugin-vue2/issues"
|
||||
},
|
||||
"homepage": "https://github.com/vitejs/vite-plugin-vue2/#readme",
|
||||
"peerDependencies": {
|
||||
"vite": "^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0 || ^7.0.0",
|
||||
"vue": "^2.7.0-0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/fs-extra": "^9.0.13",
|
||||
"conventional-changelog-cli": "^2.2.2",
|
||||
"debug": "^4.3.4",
|
||||
"enquirer": "^2.3.6",
|
||||
"esno": "^0.16.3",
|
||||
"execa": "^4.1.0",
|
||||
"fs-extra": "^10.1.0",
|
||||
"hash-sum": "^2.0.0",
|
||||
"minimist": "^1.2.6",
|
||||
"picocolors": "^1.0.0",
|
||||
"prettier": "^2.7.1",
|
||||
"puppeteer": "^14.4.0",
|
||||
"rollup": "^2.75.6",
|
||||
"semver": "^7.3.7",
|
||||
"slash": "^3.0.0",
|
||||
"source-map": "^0.6.1",
|
||||
"unbuild": "^0.7.4",
|
||||
"vite": "^3.0.0",
|
||||
"vitest": "^0.15.1",
|
||||
"vue": "^2.7.0-beta.8"
|
||||
},
|
||||
"scripts": {
|
||||
"dev": "unbuild --stub",
|
||||
"build": "unbuild && esno scripts/patchCJS.ts",
|
||||
"test": "vitest run",
|
||||
"release": "node scripts/release.js",
|
||||
"changelog": "conventional-changelog -p angular -i CHANGELOG.md -s"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user