Socket
Socket
Sign inDemoInstall

babel-plugin-remove-vue-extend

Package Overview
Dependencies
0
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    babel-plugin-remove-vue-extend

Babel plugin for removing `Vue.extend` from components


Version published
Weekly downloads
1
decreased by-83.33%
Maintainers
1
Install size
5.63 kB
Created
Weekly downloads
 

Readme

Source

babel-plugin-remove-vue-extend

Babel plugin for removing Vue.extend from components.

Usage

Install:

npm install babel-plugin-remove-vue-extend
# or
yarn add babel-plugin-remove-vue-extend

.babelrc:

{
  "plugins": ["remove-vue-extend"]
}

Then if you have the following component:

import Vue from 'vue'

export default Vue.extend({
  data() {
    return { message: 'Hello!' }
  }
})

It will be transformed into:

export default {
  data() {
    return { message: 'Hello!' }
  }
}

If you are using some extended component and extend from it like:

import Sub from './Sub.vue'

export default Sub.extend({
  data() {
    return { message: 'Hello!' }
  }
})

It will be removed the extend call expression but moved into extends option:

import Sub from './Sub.vue'

export default {
  extends: Sub,

  data() {
    return { message: 'Hello!' }
  }
}

License

MIT

Keywords

FAQs

Last updated on 07 Mar 2018

Did you know?

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

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc