Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dart Sass support as a stylesheet preprocessor option #1782

Closed
FossPrime opened this issue Jul 7, 2018 · 9 comments · Fixed by #3321
Closed

Dart Sass support as a stylesheet preprocessor option #1782

FossPrime opened this issue Jul 7, 2018 · 9 comments · Fixed by #3321
Labels
contribution welcome enhancement intend to implement The team has the intention to implement this feature at some point. Contribution is also welcome.

Comments

@FossPrime
Copy link
Contributor

What problem does this feature solve?

node-sass is the most painful node dependency in the entirety of the npm ecosystem. Plus dart sass is faster, allows code sharing with docker (no binaries), never breaks installations after a system or node update...

I realize there will be limitations... which I'm willing to work around for the benefits

What does the proposed API look like?

$ vue-cli generate foo

Sass ( node-sass )
Sass ( Dart Sass - Experimental ) *
Less
Stylus
@LinusBorg
Copy link
Member

We don't have a hard dependency on node-sass - sass-loadee needs it. Does sass-loadee support dart-sass as well, or does a fork exist or something?

At the end of the day we need a loader for it.

@Gnuk
Copy link

Gnuk commented Jul 7, 2018

As I can see, in webpack-contrib/sass-loader#435, it's not currently supported inside sass-loader.

The merge request webpack-contrib/sass-loader#573 let sass-loader be "implementation-agnostic" but it's not currently merged.

I think it's a good idea to have dart-sass because it's the official package referenced in Sass lang as a npm provider:

But I think you'll wait sass-loader support dart-sass if you want webpack support.

@LinusBorg
Copy link
Member

Well I'm not sure how using dart sass would work without a loader supporting it, since the whole build process of vue-cli is built around webpack.

@FossPrime
Copy link
Contributor Author

@LinusBorg webpack-contrib/sass-loader#573 is the loader

it could be implemented as a generator time option... like fountainjs has been doing it... Sass (dart-sass experimental)

@LinusBorg
Copy link
Member

Well, that PR hasn't been merged yet, so as of today there's no loader that supports dart -sass, right?

@FossPrime
Copy link
Contributor Author

The prophecy is upon us:

Rather than always loading Node Sass, this now requires users to pass in
either Dart Sass or Node Sass as an option to the loader.

commit: bed9fb5799a90020d43f705ea405f85b368621d7

webpack-contrib/sass-loader@bed9fb5

@wujekbogdan
Copy link

IMO dart-sass should be the default sass compiler because now it's the official sass compiler.

@Gnuk
Copy link

Gnuk commented Aug 24, 2018

It's also my opinion but like I see after the merge request of the sass loader, node-sass still the default implementation proposed. It could be a choice during creation from vue cli I think.

@beary
Copy link

beary commented Sep 29, 2018

I tried to use dart-sass according sass-loader's example and it works well.

/* vue.config.js */
module.exports = {
  css: {
    loaderOptions: {
      sass: {
        implementation: require('sass')
      }
    }
  }
}
"devDependencies": {
  "@vue/cli-plugin-babel": "^3.0.4",
  "@vue/cli-plugin-typescript": "^3.0.4",
  "@vue/cli-service": "^3.0.4",
  "sass": "^1.14.1",
  "sass-loader": "^7.0.1",
  "typescript": "^3.0.0",
  "vue-template-compiler": "^2.5.17"
}

@LinusBorg LinusBorg added contribution welcome intend to implement The team has the intention to implement this feature at some point. Contribution is also welcome. and removed upstream labels Oct 11, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contribution welcome enhancement intend to implement The team has the intention to implement this feature at some point. Contribution is also welcome.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants