This repository was archived by the owner on Jan 18, 2022. It is now read-only.
This repository was archived by the owner on Jan 18, 2022. It is now read-only.
Component style missing after tree-shaking #104
Closed
Description
hello.vue
:
<template>
<div class="container">
<p v-for="item in list" :data-total="total">
{{item}}
</p>
</div>
</template>
<script>
export default {
data: function () {
return {
list: ['hello', 'world'],
total: 123
}
}
}
</script>
<style scoped>
.container {
background: #eff;
}
</style>
entry.js
:
import hello from './hello.vue';
new Vue({
el: '#vueApp',
components: { hello },
template: `
<hello/>
`
})
Expected behavior
Compile .vue to .js, contains style parts.
Actual behavior
Generated .js doesn't contains style parts.
var hello = { render: function render() {
var _vm = this;var _h = _vm.$createElement;var _c = _vm._self._c || _h;return _c('div', { staticClass: "container" }, _vm._l(_vm.list, function (item) {
return _c('p', { attrs: { "data-total": _vm.total } }, [_vm._v(_vm._s(item))]);
}));
}, staticRenderFns: [], _scopeId: 'data-v-9d9be692',
data: function data() {
return {
list: ['hello', 'world'],
total: 123
};
}
};
new vue$1({
el: '#vueApp',
components: { hello: hello },
template: '\n <hello/>\n '
});
Steps to reproduce the behavior
Use gulp-better-rollup
with rollup-plugin-vue
to compile entry.js
.
Metadata
Metadata
Assignees
Labels
No labels