danielstgt / laravel-mix-svg-vue

A Laravel Mix extension to inline SVG files with Vue.js and automatically optimize them with SVGO
MIT License
38 stars 9 forks source link

Vue 3 without options API #6

Closed dacoto97 closed 3 years ago

dacoto97 commented 3 years ago

If we are using vue3 with the options api disabled, it doesn't work, as the mixins are for the old options api, which is a temporary transition between vue 2 and vue 3.

danielstgt commented 3 years ago

Could you share a code example? I couldn't find anything how to disable the options API explicitly, I want to make sure I'm debugging the right case. Sorry if I went too fast through the docs and missed that.

dacoto97 commented 3 years ago
.webpackConfig({
    plugins: [
      new webpack.DefinePlugin({
        __VUE_OPTIONS_API__: false,
        __VUE_PROD_DEVTOOLS__: false
      })
    ]
  })
danielstgt commented 3 years ago

This issue was very helpful, I learned a lot about the composition API - thanks!

There is a new release available (v0.3.2) that uses exclusively the composition API for the svg-vue3 dependency.

I've tested it with your provided config to disable the options API. If you still encounter any problems, feel free to reopen this issue.

dacoto97 commented 3 years ago

[Vue warn]: Mixins are only available in builds supporting Options API

IDEA [Check if vue3 is active and don't declare the mixin.] ¿?¿

Good Job! with the refactor.

danielstgt commented 3 years ago

Are you sure that warning comes from this Plugin/Library? There are no mixins used.

Could you share a CodeSandbox example with a minimal setup that shows this warning?