Research
Security News
Threat Actor Exposes Playbook for Exploiting npm to Build Blockchain-Powered Botnets
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.
vue3-sfc-loader
Advanced tools
Vue3 Single File Component loader.
Load .vue files dynamically at runtime from your html/js. No node.js environment, no (webpack) build step needed.
import()
)<html>
<body>
<div id="app"></div>
<script src="https://unpkg.com/vue@next"></script>
<script src="https://cdn.jsdelivr.net/npm/vue3-sfc-loader"></script>
<script>
const options = {
moduleCache: {
vue: Vue
},
getFile(path) {
return fetch(path).then(res => res.ok ? res.text() : Promise.reject(res));
},
addStyle(textContent) {
const style = Object.assign(document.createElement('style'), { textContent });
const ref = document.head.getElementsByTagName('style')[0] || null;
document.head.insertBefore(style, ref);
},
}
const { loadModule } = window['vue3-sfc-loader'];
const app = Vue.createApp({
components: {
'my-component': Vue.defineAsyncComponent( () => loadModule('./myComponent.vue', options) )
},
template: '<my-component></my-component>'
});
app.mount('#app');
</script>
</body>
</html>
see examples
https://codepen.io/franckfreiburger/project/editor/AqPyBr
loadModule(path
: string, options
: Options): Promise<Module>
latest minified version at :
npm install vue3-sfc-loader
(here: ./node_modules/vue3-sfc-loader/dist/vue3-sfc-loader.js
)webpack --config ./build/webpack.config.js --mode=production --env targetsBrowsers="> 1%, last 2 versions, Firefox ESR, not dead, not ie 11"
see package.json
"build" script
see browserslist queries
vue3-sfc-loader.js
= Webpack
( @vue/compiler-sfc
+ @babel
)
.vue
file@vue/compiler-sfc
)@babel
)@babel/traverse
)ask here: https://stackoverflow.com/questions/ask?tags=vue3-sfc-loader (see previous questions)
see http-vue-loader
FAQs
Single File Component loader
The npm package vue3-sfc-loader receives a total of 2,871 weekly downloads. As such, vue3-sfc-loader popularity was classified as popular.
We found that vue3-sfc-loader demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
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.
Research
Security News
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.
Security News
NVD’s backlog surpasses 20,000 CVEs as analysis slows and NIST announces new system updates to address ongoing delays.
Security News
Research
A malicious npm package disguised as a WhatsApp client is exploiting authentication flows with a remote kill switch to exfiltrate data and destroy files.