Open spacedawwwg opened 3 years ago
5.0.0
https://codesandbox.io/s/crazy-engelbart-c3bw0?file=/src/components/HelloWorld.vue
add custom block to vue sfc with a src attribute. e.g:
configure rollup-plugin vue to include 'my-thing' custom block
vue({ customBlocks: ['my-thing'] }),
add transform to rollup to handle custom block, e.g
function myThing() { const filter = createFilter([/my-thing/]); return { transform(code, id) { if (filter(id)) { return { code: ` export default function (Component) { Component.options.__my_thing = ${JSON.stringify(code)}; } `, map: null, }, }; } }
when using the transform, I'd expect to be able to access the 'src' attribute either as a path or from the code prop.
code
'code' is undefined and src isn't available as a path
Version
5.0.0
Reproduction link
https://codesandbox.io/s/crazy-engelbart-c3bw0?file=/src/components/HelloWorld.vue
Steps to reproduce
add custom block to vue sfc with a src attribute. e.g:
configure rollup-plugin vue to include 'my-thing' custom block
add transform to rollup to handle custom block, e.g
What is expected?
when using the transform, I'd expect to be able to access the 'src' attribute either as a path or from the
code
prop.What is actually happening?
'code' is undefined and src isn't available as a path