Giter VIP home page Giter VIP logo

vue-cli-plugin-scss-base's People

Contributors

milad-alizadeh avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

vue-cli-plugin-scss-base's Issues

Failed to extend rule defined in utillities.scss

Hey, I coming again ๐Ÿ˜€.

The rule defined in utillities.scss(like .u-visually-hidden) failed to be extended in component scss.

<style lang="scss" module>
.item {
  .label {
    @extend .u-visually-hidden;
  }
}
</style>

The error:

Module build failed (from ./node_modules/sass-loader/lib/loader.js):

  }
           ^
      ".item .label" failed to @extend ".u-visually-hidden".
The selector ".u-visually-hidden" was not found.
Use "@extend .u-visually-hidden !optional" if the extend should be able to fail.
      in xxx.vue

But it can be used as inline class

<template>
    <!-- ok -->
    <div class="u-visually-hidden"></div>
<template>

Every Component includes all scss content when using css module.

My every component use css module:

<style lang="scss" module>
.foo {}
</style>

And used in template:

<template>
  <div :class="$style.foo"></div>
</template>

But I found in every style link, the all css rules in scss directory was included in single component css module.
component A style
image
component B style
image

Is the configure reason that import base.scss in every css module?

css: {
    loaderOptions: {
      sass: {
        data: '@import "@/scss/base.scss";',
      },
    },
  },

BUG: ValidationError: Invalid options object. Sass Loader has been initialised using an options object that does not match the API schema.

On this package list:

    "sass": "^1.19.0",
    "sass-loader": "^8.0.0",
    "storybook-addon-vue-info": "1.1.1",
    "storybook-vue-router": "1.0.3",
    "typescript": "~3.5.3",
    "vue-cli-plugin-atomic-design": "^0.3.3",
    "vue-cli-plugin-electron-builder": "^1.4.0",
    "vue-cli-plugin-pug": "^1.0.7",
    "vue-cli-plugin-scss-base": "0.2.2",
    "vue-template-compiler": "^2.6.10"

and this configuration

  css: {
    loaderOptions: {
      sass: {
        data: '@import "@/scss/settings.scss";'
      }
    }
  }

I've got error

 ERROR  Failed to compile with 2 errors                                                                                                                                                                        18:43:37

 error  in ./src/App.vue?vue&type=style&index=0&lang=scss&

Module build failed (from ./node_modules/sass-loader/dist/cjs.js):
ValidationError: Invalid options object. Sass Loader has been initialised using an options object that does not match the API schema.
 - options has an unknown property 'data'. These properties are valid:
   object { implementation?, sassOptions?, prependData?, sourceMap?, webpackImporter? }

To fix this I have to change the configuration to:

  css: {
    loaderOptions: {
      sass: {
        prependData: '@import "@/scss/settings.scss";'
      }
    }
  }

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.