New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

unplugin-vue-script-name

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

unplugin-vue-script-name

Support <script name> for Vue script setup

latest
Source
npmnpm
Version
0.1.5
Version published
Maintainers
1
Created
Source

unplugin-vue-script-name

NPM version

Support <script name> for Vue script setup.

Install

npm i -D unplugin-vue-script-name
Vite
// vite.config.ts
import scriptName from "unplugin-vue-script-name/vite";

export default defineConfig({
  plugins: [
    scriptName({
      /* options */
    })
  ]
});

Example: playground/


Rollup
// rollup.config.js
import scriptName from "unplugin-vue-script-name/rollup";

export default {
  plugins: [
    scriptName({
      /* options */
    })
  ]
};


Webpack
// webpack.config.js
module.exports = {
  /* ... */
  plugins: [
    require("unplugin-vue-script-name/webpack").default({
      /* options */
    })
  ]
};


Nuxt
// nuxt.config.js
export default {
  buildModules: [
    [
      "unplugin-vue-script-name/nuxt",
      {
        /* options */
      }
    ]
  ]
};

This module works for both Nuxt 2 and Nuxt Vite


Vue CLI
// vue.config.js
module.exports = {
  configureWebpack: {
    plugins: [
      require("unplugin-vue-script-name/webpack").default({
        /* options */
      })
    ]
  }
};


How It Works

<!-- MyComponent.vue -->
<script setup lang="ts" name="MyComponent">
  defineProps({
    title: { type: String }
  });
</script>

<template>
  <h1>{{title}}</h1>
</template>
<!-- Will be transformed to -->
<script>
  export default { name: "MyComponent" };
</script>

<script setup lang="ts">
  defineProps({
    title: { type: String }
  });
</script>

<template>
  <h1>{{title}}</h1>
</template>

Keywords

vue

FAQs

Package last updated on 20 Feb 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts