Using the compiled component #93
Description
Hello,
Sorry to be asking this, as I appreciate that this may be a stupid question, but I am just unsure.
So I have followed the instructions and successfully compiled and output a .vue component with the output of the assembly function. I am just confused as to what I can do with it after that?
My company requires that we vet all parts of a compilation process (due to security) so we are trying to do it without using other peoples packages.
So I was wondering exactly what am I missing to get this working? Do I need to do something else, like transpile it? as I can see the current exported component once it's been ran through this library is not usable on the browser.
So in short, what do I need to do to the output of the component to get it so I can load it into Vue as a component?
I have the following:
const VueComponentCompiler = require('@vue/component-compiler');
const fs = require('fs');
const path = require('path');
const VueCompiler = VueComponentCompiler.createDefaultCompiler();
const vComponent = VueCompiler.compileToDescriptor('component.vue', fs.readFileSync(path.resolve('component.vue'), 'utf8'));
const assembledComponent = VueComponentCompiler.assemble(vComponent, 'component.vue', vComponent);
fs.writeFileSync('component.vue.js', assembledComponent.code);
Thank you any hints or nudges in the right direction would be extremely appreciated!
Thanks,
Danny