vuetifyjs / vue-cli-plugins

🔌 A collection of Vuetify plugins for Vue CLI
https://vuetifyjs.com/en/getting-started/quick-start#vue-cli-3
Other
428 stars 113 forks source link

[Bug Report] Using namespaced Vuetify presets to import fails #166

Closed ukitiyan closed 3 years ago

ukitiyan commented 4 years ago

Environment

Steps to reproduce

  1. Add own vue-cli-plugin-vuetify-preset with namespace
    $ npm install @mynamespace/vue-cli-plugin-vuetify-preset-mypreset
  2. Register with plugin
    
    const { preset } = require('@mynamespace/vue-cli-plugin-vuetify-preset-mypreset/preset');

export const VUETIFY_OPTIONS = { preset, }; Vue.use(Vuetify); export default new Vuetify(VUETIFY_OPTIONS);

3. Launch the application
```sh
$ npm run serve

Expected behaviour

npm run serve runs successfully.

Actual behaviour

The following error occurs.

error  in ./src/components/XXX

Module build failed (from ./node_modules/sass-loader/dist/cjs.js):
SassError: Can't find stylesheet to import.
  ╷
1 │ @import '~vue-cli-plugin-vuetify-preset-mypreset/preset/variables.scss';
  │         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  ╵

Other comments

I consider the following implementations to be relevant. Waiting for your answer. Thank you in advance.

https://github.com/vuetifyjs/vue-cli-plugins/blob/addc5bcf028fbe65c02b581884032244519fb295/packages/cli-plugin-utils/index.js#L176-L179

cotufaloschiflones commented 4 years ago

Hello,

I'm facing the same issue, is there some progress or new info on this? @ukitiyan Did you find any solution or workaround?

My environment is with: Vuetify Version: 2.2.11 && Vue Version: 2.6.11

cotufaloschiflones commented 4 years ago

function VuetifyPresetService (api, preset) { injectSassVariables(api, ´~${api.id}/preset/variables.scss´) }

maybe this should do the work?

ukitiyan commented 4 years ago

I'm facing the same issue, is there some progress or new info on this? @ukitiyan Did you find any solution or workaround?

@cotufaloschiflones I don't have a solution yet. Does ~${api.id} inject the alias?

cotufaloschiflones commented 4 years ago

hello @ukitiyan, api.id seems to be the packageName defined in package.json, I was making some tests and I made it work yesterday like this, but I'm not sure if api.id is taking his value from the package.json name key, I have to dig a bit more to confirm it

cotufaloschiflones commented 4 years ago

Hi @ukitiyan, you can give a try with this PR

ukitiyan commented 4 years ago

@cotufaloschiflones , Thank you! I try the test, and feed back.

johnleider commented 3 years ago

This Issue is being closed due to inactivity.

If you have any questions, please reach out to us in our Discord community.