Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@vitejs/plugin-vue

Package Overview
Dependencies
Maintainers
5
Versions
107
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@vitejs/plugin-vue - npm Package Compare versions

Comparing version 4.2.3 to 4.3.0

dist/index.d.cts

2

dist/index.d.ts

@@ -24,3 +24,3 @@ import { ViteDevServer, Plugin } from 'vite';

isProduction?: boolean;
script?: Partial<Pick<SFCScriptCompileOptions, 'babelParserPlugins' | 'defineModel' | 'propsDestructure' | 'fs' | 'reactivityTransform'>>;
script?: Partial<Pick<SFCScriptCompileOptions, 'babelParserPlugins' | 'globalTypeFiles' | 'defineModel' | 'propsDestructure' | 'fs' | 'reactivityTransform' | 'hoistStatic'>>;
template?: Partial<Pick<SFCTemplateCompileOptions, 'compiler' | 'compilerOptions' | 'preprocessOptions' | 'preprocessCustomRequire' | 'transformAssetUrls'>>;

@@ -27,0 +27,0 @@ style?: Partial<Pick<SFCStyleCompileOptions, 'trim'>>;

{
"name": "@vitejs/plugin-vue",
"version": "4.2.3",
"version": "4.3.0",
"license": "MIT",

@@ -14,3 +14,2 @@ "author": "Evan You",

".": {
"types": "./dist/index.d.ts",
"import": "./dist/index.mjs",

@@ -43,11 +42,11 @@ "require": "./dist/index.cjs"

"devDependencies": {
"@jridgewell/gen-mapping": "^0.3.2",
"@jridgewell/trace-mapping": "^0.3.17",
"@jridgewell/gen-mapping": "^0.3.3",
"@jridgewell/trace-mapping": "^0.3.19",
"debug": "^4.3.4",
"rollup": "^3.17.2",
"slash": "^5.0.0",
"slash": "^5.1.0",
"source-map": "^0.6.1",
"vite": "^4.3.5",
"vue": "^3.3.0-beta.5"
"vite": "^4.4.9",
"vue": "^3.3.4"
}
}

@@ -26,3 +26,14 @@ # @vitejs/plugin-vue [![npm](https://img.shields.io/npm/v/@vitejs/plugin-vue.svg)](https://npmjs.com/package/@vitejs/plugin-vue)

// options to pass on to vue/compiler-sfc
script?: Partial<Pick<SFCScriptCompileOptions, 'babelParserPlugins'>>
script?: Partial<
Pick<
SFCScriptCompileOptions,
| 'babelParserPlugins'
| 'globalTypeFiles'
| 'defineModel'
| 'propsDestructure'
| 'fs'
| 'reactivityTransform'
>
>
template?: Partial<

@@ -133,8 +144,11 @@ Pick<

transform(code, id) {
// if .vue file don't have <i18n> block, just return
if (!/vue&type=i18n/.test(id)) {
return
}
// parse yaml
if (/\.ya?ml$/.test(id)) {
code = JSON.stringify(yaml.load(code.trim()))
}
// mount the value on the i18n property of the component instance
return `export default Comp => {

@@ -151,2 +165,26 @@ Comp.i18n = ${code}

Create a file named `Demo.vue`, add `lang="yaml"` to the `<i18n>` blocks, then you can use the syntax of `YAML`:
```vue
<template>Hello</template>
<i18n lang="yaml">
message: 'world'
fullWord: 'hello world'
</i18n>
```
`message` is mounted on the i18n property of the component instance, you can use like this:
```vue
<script setup lang="ts">
import Demo from 'components/Demo.vue'
</script>
<template>
<Demo /> {{ Demo.i18n.message }}
<div>{{ Demo.i18n.fullWord }}</div>
</template>
```
## Using Vue SFCs as Custom Elements

@@ -153,0 +191,0 @@

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc