vue-blservice-loader
Advanced tools
Comparing version
@@ -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", |
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
6522
118.05%4
33.33%153
168.42%0
-100%