You're Invited: Meet the Socket team at BSidesSF and RSAC - April 27 - May 1.RSVP
Socket
Sign inDemoInstall
Socket

vue-blservice-loader

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vue-blservice-loader - npm Package Compare versions

Comparing version

to
1.1.1

beforeDestroy.js

7

index.js

@@ -6,10 +6,11 @@ const path = require('path');

const escodegen = require('escodegen');
const beforeDestroy = require('./beforeDestroy');
module.exports = function (source) {
if (source.substr(0, 34) === '<!-- webview only --><!-- slot -->') {
return `<template><div><slot></slot></div></template><script>export default { methods: {} }</script>`;
return `<template><div><slot></slot></div></template><script>export default { methods: {}, beforeDestroy() { delete this.$root.$page.components[this._bili_id || this._uid] } }</script>`;
}
if (source.substr(0, 21) === '<!-- webview only -->') {
return `<template><div></div></template><script>export default { methods: {} }</script>`;
return `<template><div></div></template><script>export default { methods: {}, beforeDestroy() { delete this.$root.$page.components[this._bili_id || this._uid] } }</script>`;
}

@@ -55,2 +56,4 @@

beforeDestroy(exportDefault.properties);
// 检查import,对service来说,只有js/vue的import有用

@@ -57,0 +60,0 @@ let imports = bodyEsprima.filter(item => item.type === 'ImportDeclaration');

{
"name": "vue-blservice-loader",
"version": "1.1.0",
"version": "1.1.1",
"description": "vue bl service loader",

@@ -5,0 +5,0 @@ "main": "index.js",