Skip to content
This repository has been archived by the owner on Jan 25, 2024. It is now read-only.

Scss compilation #69

Open
Arturokin12 opened this issue May 23, 2019 · 4 comments
Open

Scss compilation #69

Arturokin12 opened this issue May 23, 2019 · 4 comments
Labels

Comments

@Arturokin12
Copy link

I've been working with scss tag but, using the code in the example, i can't get it to work, i just see a "ReferenceError: sass is not defined" message, how can i make this work?

@ZhaolYang
Copy link

I have the same question, where can I get the sass.js ?

@joshgrift
Copy link

Likewise! It doesn't seem to be the dart-sass compilation.

@longqizhu
Copy link

I have the same question

@uier
Copy link

uier commented Feb 12, 2021

As mentioned in #33, you can get sass.js from https://github.com/medialize/sass.js

To avoid receiving "ReferenceError: sass is not defined", declare a variable sass and assign an instance constructed by sass.js.

The following example works for me.

<script src="<path_to>/sass.js"></script>
<script>
  const sass = new Sass()
  httpVueLoader.langProcessor.scss = function (scssText) {
    return new Promise(function(resolve, reject) {
      sass.compile(scssText, function (result) {
        if ( result.status === 0 )
          resolve(result.text)
        else
          reject(result)
      });
    });
  }
  new Vue({
    el: '#my-app',
    components: {
      'my-component': httpVueLoader('my-component.vue')
    }
  });
</script>

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

6 participants