Skip to content
This repository has been archived by the owner on Feb 17, 2023. It is now read-only.

Commit

Permalink
fix(deps): move vue-template-compiler to peerDependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
underfin committed Jun 27, 2021
1 parent eb26e6e commit 4de9cb8
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 26 deletions.
5 changes: 0 additions & 5 deletions README.MD
Expand Up @@ -15,11 +15,6 @@ module.exports = {

## [Options](https://github.com/underfin/vite-plugin-vue2/blob/master/src/index.ts#L26)

### `vueTemplateCompiler`

Type: `Object`<br>

You can custom `vue-template-compiler` version or other compiler.
### `vueTemplateOptions`

Type: `Object`<br>
Expand Down
6 changes: 3 additions & 3 deletions package.json
Expand Up @@ -57,11 +57,11 @@
"rollup": "^2.35.1",
"slash": "^3.0.0",
"source-map": "^0.7.3",
"vue-template-es2015-compiler": "^1.9.1",
"vue-template-compiler": "^2.2.0"
"vue-template-es2015-compiler": "^1.9.1"
},
"peerDependencies": {
"vite": "^2.0.0-beta.23"
"vite": "^2.0.0-beta.23",
"vue-template-compiler": "^2.2.0"
},
"devDependencies": {
"@types/consolidate": "^0.14.0",
Expand Down
5 changes: 0 additions & 5 deletions src/index.ts
Expand Up @@ -12,7 +12,6 @@ import { ViteDevServer, Plugin } from 'vite'
import { SFCBlock } from '@vue/component-compiler-utils'
import { handleHotUpdate } from './hmr'
import { transformVueJsx } from './jsxTransform'
import { VueTemplateCompiler } from './template/types'

export const vueComponentNormalizer = '\0/vite/vueComponentNormalizer'
export const vueHotReload = '\0/vite/vueHotReload'
Expand All @@ -27,10 +26,6 @@ declare module '@vue/component-compiler-utils' {
export interface VueViteOptions {
include?: string | RegExp | (string | RegExp)[]
exclude?: string | RegExp | (string | RegExp)[]
/**
* Custom vue template compiler.
*/
vueTemplateCompiler?: VueTemplateCompiler
/**
* The options for `@vue/component-compiler-utils`.
*/
Expand Down
14 changes: 3 additions & 11 deletions src/template.ts
@@ -1,5 +1,5 @@
import { SFCBlock } from '@vue/component-compiler-utils'
import * as defaultVueTemplateCompiler from 'vue-template-compiler'
import * as vueTemplateCompiler from 'vue-template-compiler'
import { TransformPluginContext } from 'rollup'
import { ResolvedOptions } from './index'
import { createRollupError } from './utils/error'
Expand All @@ -10,11 +10,7 @@ export function compileSFCTemplate(
source: string,
block: SFCBlock,
filename: string,
{
isProduction,
vueTemplateOptions = {},
vueTemplateCompiler = defaultVueTemplateCompiler as any,
}: ResolvedOptions,
{ isProduction, vueTemplateOptions = {} }: ResolvedOptions,
pluginContext: TransformPluginContext
) {
const { tips, errors, code } = compileTemplate({
Expand Down Expand Up @@ -54,11 +50,7 @@ export function compileSFCTemplate(
generateCodeFrame &&
vueTemplateOptions.compilerOptions?.outputSourceRange
) {
const {
msg,
start,
end,
} = error as defaultVueTemplateCompiler.ErrorWithRange
const { msg, start, end } = error as vueTemplateCompiler.ErrorWithRange
return pluginContext.error(
createRollupError(filename, {
message: msg,
Expand Down
4 changes: 2 additions & 2 deletions yarn.lock
Expand Up @@ -5907,9 +5907,9 @@ vite@^2.0.5:
optionalDependencies:
fsevents "~2.3.1"

vue-template-compiler@^2.2.0:
vue-template-compiler@^2.6.12:
version "2.6.14"
resolved "https://registry.yarnpkg.com/vue-template-compiler/-/vue-template-compiler-2.6.14.tgz#a2f0e7d985670d42c9c9ee0d044fed7690f4f763"
resolved "https://registry.npmjs.org/vue-template-compiler/-/vue-template-compiler-2.6.14.tgz#a2f0e7d985670d42c9c9ee0d044fed7690f4f763"
integrity sha512-ODQS1SyMbjKoO1JBJZojSw6FE4qnh9rIpUZn2EUT86FKizx9uH5z6uXiIrm4/Nb/gwxTi/o17ZDEGWAXHvtC7g==
dependencies:
de-indent "^1.0.2"
Expand Down

0 comments on commit 4de9cb8

Please sign in to comment.