pipe01 / esbuild-plugin-vue3

esbuild plugin for loading Vue 3 SFC files
MIT License
59 stars 13 forks source link

Unable to import default and specific objects form a component #8

Open devunion opened 2 years ago

devunion commented 2 years ago

Hello, I'm trying to port my app from Webpack to ESBuild and see the following problem with imports resolving:

module.vue:
<template></template>
<script>
export const FOO = 'foo';
export default {
  data() {
    return {
      bar: 'bar'
    }
  }
}
</script>

app.js:
import Module, {FOO} from './module.vue';

console.log('Module: ', Module);
console.log('FOO: ', FOO);

Error:

Error: Build failed with 1 error:
test2/app.js:1:16: ERROR: No matching export in "test2/module.vue" for import "FOO"

This kind of import does not work in the app. Is there any option to configure the plugin to resolve the problem?