vue-cli-plugin-quasar icon indicating copy to clipboard operation
vue-cli-plugin-quasar copied to clipboard

Importing type does not work from quasar if the 'js-transform-quasar-imports" rule is enabled

Open Tofandel opened this issue 1 year ago • 0 comments

Describe the bug A clear and concise description of what the bug is.

To Reproduce Add to your app.ts

import { Dialog, Notify, Quasar, type QuasarPlugins } from 'quasar';
import { createApp } from 'vue';

const vue = createApp({
        inheritAttrs: false,
      }).use(Quasar, {
          plugins: [Dialog, Notify] as QuasarPlugins,
        })

Or to any other file import a type from quasar

import { QTableProps } from 'quasar';

The build fails with error Error: Unknown import from Quasar: QTableProps

If you remove the rule from webpack, then it all imports correctly

This is because the plugin runs a "dumb" transform on the import and doesn't know if the user is importing a type or an actual js export

This works correctly if the js-transform-quasar-imports is added before the ts-loader but it's not the case by default

Expected behavior The build to not fail when importing a type

Tofandel avatar Sep 23 '24 15:09 Tofandel