Repository: vitejs/vite-plugin-vue2 Branch: main Commit: 7a2fcf614837 Files: 62 Total size: 85.4 KB Directory structure: gitextract_x4bnptxt/ ├── .github/ │ └── workflows/ │ ├── ci.yml │ ├── issue-close-require.yml │ ├── issue-labeled.yml │ └── release-tag.yml ├── .gitignore ├── .node-version ├── .prettierrc ├── CHANGELOG.md ├── LICENSE ├── README.md ├── build.config.ts ├── package.json ├── playground/ │ ├── .pnpm-debug.log │ ├── App.vue │ ├── ScriptSetup.vue │ ├── TestES2020Features.vue │ ├── css/ │ │ ├── TestCssModules.vue │ │ ├── TestCssVBind.vue │ │ ├── TestEmptyCss.vue │ │ ├── TestScopedCss.vue │ │ └── testCssModules.module.css │ ├── custom/ │ │ ├── TestCustomBlock.vue │ │ └── custom.json │ ├── hmr/ │ │ └── TestHmr.vue │ ├── index.html │ ├── main.js │ ├── package.json │ ├── shims.d.ts │ ├── src-import/ │ │ ├── TestBlockSrcImport.vue │ │ ├── TestMultiplySrcImport.vue │ │ ├── script.ts │ │ ├── style.css │ │ └── template.html │ ├── test-assets/ │ │ └── TestAssets.vue │ ├── test-component/ │ │ ├── TestComponent.vue │ │ ├── async/ │ │ │ ├── TestAsyncComponent.vue │ │ │ ├── componentA.vue │ │ │ └── componentB.vue │ │ └── recursive/ │ │ ├── TestRecursive.vue │ │ ├── TestRecursiveTree.vue │ │ └── treedata.json │ ├── tsconfig.json │ └── vite.config.ts ├── pnpm-workspace.yaml ├── scripts/ │ ├── patchCJS.ts │ └── release.js ├── src/ │ ├── compiler.ts │ ├── handleHotUpdate.ts │ ├── index.ts │ ├── main.ts │ ├── script.ts │ ├── style.ts │ ├── template.ts │ └── utils/ │ ├── componentNormalizer.ts │ ├── descriptorCache.ts │ ├── error.ts │ ├── hmrRuntime.ts │ └── query.ts ├── test/ │ ├── test.spec.ts │ ├── util.ts │ └── vitest.config.ts └── tsconfig.json ================================================ FILE CONTENTS ================================================ ================================================ FILE: .github/workflows/ci.yml ================================================ name: 'ci' on: push: branches: - '**' pull_request: branches: - main jobs: test: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - name: Install pnpm uses: pnpm/action-setup@v2 - name: Set node version to 16 uses: actions/setup-node@v4 with: node-version-file: '.node-version' cache: 'pnpm' - run: pnpm install - name: Run tests run: pnpm test ================================================ FILE: .github/workflows/issue-close-require.yml ================================================ name: Issue Close Require on: schedule: - cron: "0 0 * * *" jobs: close-issues: runs-on: ubuntu-latest steps: - name: need reproduction uses: actions-cool/issues-helper@v3 with: actions: "close-issues" token: ${{ secrets.GITHUB_TOKEN }} labels: "need reproduction" inactive-day: 3 ================================================ FILE: .github/workflows/issue-labeled.yml ================================================ name: Issue Labeled on: issues: types: [labeled] jobs: reply-labeled: runs-on: ubuntu-latest steps: - name: contribution welcome if: github.event.label.name == 'contribution welcome' || github.event.label.name == 'help wanted' uses: actions-cool/issues-helper@v3 with: actions: "create-comment, remove-labels" token: ${{ secrets.GITHUB_TOKEN }} issue-number: ${{ github.event.issue.number }} body: | Hello @${{ github.event.issue.user.login }}. We like your proposal/feedback and would appreciate a contribution via a Pull Request by you or another community member. We thank you in advance for your contribution and are looking forward to reviewing it! labels: "pending triage, need reproduction" - name: remove pending if: contains(github.event.label.description, '(priority)') && contains(github.event.issue.labels.*.name, 'pending triage') uses: actions-cool/issues-helper@v3 with: actions: "remove-labels" token: ${{ secrets.GITHUB_TOKEN }} issue-number: ${{ github.event.issue.number }} labels: "pending triage" - name: remove enhancement pending if: "(github.event.label.name == 'enhancement' || contains(github.event.label.description, '(priority)')) && contains(github.event.issue.labels.*.name, 'enhancement: pending triage')" uses: actions-cool/issues-helper@v3 with: actions: "remove-labels" token: ${{ secrets.GITHUB_TOKEN }} issue-number: ${{ github.event.issue.number }} labels: "enhancement: pending triage" - name: need reproduction if: github.event.label.name == 'need reproduction' uses: actions-cool/issues-helper@v3 with: actions: "create-comment, remove-labels" token: ${{ secrets.GITHUB_TOKEN }} issue-number: ${{ github.event.issue.number }} body: | Hello @${{ github.event.issue.user.login }}. Please provide a [minimal reproduction](https://stackoverflow.com/help/minimal-reproducible-example) using a GitHub repository or [StackBlitz](https://stackblitz.com/edit/vitejs-vite-xj3ufp?file=src/App.vue). Issues marked with `need reproduction` will be closed if they have no activity within 3 days. labels: "pending triage" ================================================ FILE: .github/workflows/release-tag.yml ================================================ on: push: tags: - 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10 name: Create Release jobs: build: name: Create Release runs-on: ubuntu-latest steps: - name: Checkout code uses: actions/checkout@master - name: Create Release for Tag id: release_tag uses: yyx990803/release-tag@master env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: tag_name: ${{ github.ref }} body: | Please refer to [CHANGELOG.md](https://github.com/vitejs/vite-plugin-vue2/blob/main/CHANGELOG.md) for details. ================================================ FILE: .gitignore ================================================ dist node_modules TODOs.md temp .DS_Store ================================================ FILE: .node-version ================================================ v16 ================================================ FILE: .prettierrc ================================================ semi: false singleQuote: true printWidth: 80 trailingComma: 'none' arrowParens: 'avoid' ================================================ FILE: CHANGELOG.md ================================================ ## [2.3.3](https://github.com/vitejs/vite-plugin-vue2/compare/v2.3.2...v2.3.3) (2024-11-26) ## [2.3.2](https://github.com/vitejs/vite-plugin-vue2/compare/v2.3.1...v2.3.2) (2024-11-26) ### Features * support vite 6 ([#104](https://github.com/vitejs/vite-plugin-vue2/issues/104)) ([80a7442](https://github.com/vitejs/vite-plugin-vue2/commit/80a74425bbae7b5eaf549d32d30b2d046912a797)) ## [2.3.1](https://github.com/vitejs/vite-plugin-vue2/compare/v2.3.0...v2.3.1) (2023-11-16) ### Bug Fixes * exports types ([5f48994](https://github.com/vitejs/vite-plugin-vue2/commit/5f489944477ed6732c3bb36dd18f029fad970c9d)) # [2.3.0](https://github.com/vitejs/vite-plugin-vue2/compare/v2.2.0...v2.3.0) (2023-11-16) ### Features * Vite 5 Support ([#94](https://github.com/vitejs/vite-plugin-vue2/issues/94)) ([f080464](https://github.com/vitejs/vite-plugin-vue2/commit/f0804641009b42f34ef5c785fe8caf746ec94fec)) # [2.2.0](https://github.com/vitejs/vite-plugin-vue2/compare/v2.1.0...v2.2.0) (2022-12-10) ### Features * Update for Vite 4.x support ([[#71](https://github.com/vitejs/vite-plugin-vue2/issues/71)](https://github.com/vitejs/vite-plugin-vue2/issues/71)) ([#72](https://github.com/vitejs/vite-plugin-vue2/issues/72)) ([d2360be](https://github.com/vitejs/vite-plugin-vue2/commit/d2360be65b37cdf51a27843925d352866dff23d1)) # [2.1.0](https://github.com/vitejs/vite-plugin-vue2/compare/v2.0.1...v2.1.0) (2022-11-30) ### Bug Fixes * **esbuild:** transpile with esnext in dev ([#60](https://github.com/vitejs/vite-plugin-vue2/issues/60)) ([bd87898](https://github.com/vitejs/vite-plugin-vue2/commit/bd87898be4d02bd52cc8af0072db9e59a5dbd8fa)) * invalidate script module cache when it changed in hot update ([#67](https://github.com/vitejs/vite-plugin-vue2/issues/67)) ([b8e6133](https://github.com/vitejs/vite-plugin-vue2/commit/b8e6133b54bce820d93d0e4f9a9982198cdd60ee)) ### Features * resolve complier from peer dep when unable to resolve from the root ([#68](https://github.com/vitejs/vite-plugin-vue2/issues/68)) ([0ea62d2](https://github.com/vitejs/vite-plugin-vue2/commit/0ea62d2b4f8a84e87b332f4f2749aeba7f8e3145)) ## [2.0.1](https://github.com/vitejs/vite-plugin-vue2/compare/v2.0.0...v2.0.1) (2022-11-09) ### Bug Fixes * allow overwriting template.transformAssetUrls.includeAbsolute ([#48](https://github.com/vitejs/vite-plugin-vue2/issues/48)) ([7db0767](https://github.com/vitejs/vite-plugin-vue2/commit/7db076705b79d383b84e13cb375a7aa9f9f1545c)) ## [2.0.0](https://github.com/vitejs/vite-plugin-vue2/compare/v1.1.2...v2.0.0) (2022-09-13) ### Breaking Changes * only support Vite 3 ([#28](https://github.com/vitejs/vite-plugin-vue2/pull/28)) ### Bug Fixes * handle undefined on import.meta.hot.accept ([b668430](https://github.com/vitejs/vite-plugin-vue2/commit/b66843045b16516fc91512c67c4f87b6d3f4d45e)) ### Features * add compiler option in Options ([#45](https://github.com/vitejs/vite-plugin-vue2/issues/45)) ([fb47586](https://github.com/vitejs/vite-plugin-vue2/commit/fb4758637c0506e9b0e7ea6883568287f60ae077)) ## [1.1.2](https://github.com/vitejs/vite-plugin-vue2/compare/v1.1.1...v1.1.2) (2022-07-01) ### Bug Fixes * force resolution of vue to deal with deps requiring vue ([9a78726](https://github.com/vitejs/vite-plugin-vue2/commit/9a78726d77ef9aadf3c07dacd4c27828fe8f4ac8)), closes [#16](https://github.com/vitejs/vite-plugin-vue2/issues/16) * handle decorators in ts rewriteDefault fallback ([2d24d2a](https://github.com/vitejs/vite-plugin-vue2/commit/2d24d2a4a692e59b789efc9b34119cc3650bf89e)), closes [#17](https://github.com/vitejs/vite-plugin-vue2/issues/17) ## [1.1.1](https://github.com/vitejs/vite-plugin-vue2/compare/v1.1.0...v1.1.1) (2022-06-28) ### Bug Fixes * handle no template code in .vue file ([#11](https://github.com/vitejs/vite-plugin-vue2/issues/11)) ([42b0851](https://github.com/vitejs/vite-plugin-vue2/commit/42b0851425e39d5e7138114f1cc3d431cadc52ab)), closes [#15](https://github.com/vitejs/vite-plugin-vue2/issues/15) # [1.1.0](https://github.com/vitejs/vite-plugin-vue2/compare/v1.0.1...v1.1.0) (2022-06-20) ### Features * support css v-bind ([5146fd8](https://github.com/vitejs/vite-plugin-vue2/commit/5146fd8d2b852c8aed07d081811e7b81894211eb)) ## 1.0.1 (2022-06-17) ### Bug Fixes * disable prettify by default ([cd80f72](https://github.com/vitejs/vite-plugin-vue2/commit/cd80f7231d50bbf04919852e7cc72623070d9f40)) ### Features * it is working ([6c387d8](https://github.com/vitejs/vite-plugin-vue2/commit/6c387d8172d76b17df3d13a37f87d0e203bc4523)) # 1.0.0 (2022-06-17) ### Features * it is working ([6c387d8](https://github.com/vitejs/vite-plugin-vue2/commit/6c387d8172d76b17df3d13a37f87d0e203bc4523)) ================================================ FILE: LICENSE ================================================ 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. ================================================ FILE: README.md ================================================ # @vitejs/plugin-vue2 [![npm](https://img.shields.io/npm/v/@vitejs/plugin-vue2.svg)](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> template?: Partial< Pick< SFCTemplateCompileOptions, | 'compiler' | 'compilerOptions' | 'preprocessOptions' | 'transpileOptions' | 'transformAssetUrls' | 'transformAssetUrlsOptions' > > style?: Partial> } ``` ## Asset URL handling When `@vitejs/plugin-vue2` compiles the `