manGoweb / mango-cli

A project scaffolding and build tool to accelerate your development
http://mangocli.org
MIT License
30 stars 9 forks source link

Support sass ~ alias to node_modules #289

Closed ViliamKopecky closed 5 years ago

ViliamKopecky commented 5 years ago

Have you ever wanted to…

// instead of
@import '../../node_modules/something/foo/bar'

// do this
@import '~something/foo/bar'

Also useful with some external libs like Blueprint.

Enabled in your mango.yaml by setting sassNodeModulesAlias: true or custom string

enzy commented 5 years ago

Ehm I've found already made package for this https://www.npmjs.com/package/node-sass-package-importer

ViliamKopecky commented 5 years ago

Reworked using the lib @enzy mentioned 👌

VojtaStanek commented 5 years ago

We should also consider documenting this new option...

On Wed, May 29, 2019, 11:22 Viliam Kopecký notifications@github.com wrote:

@ViliamKopecky commented on this pull request.

In lib/tasks/styles.js https://github.com/manGoweb/mango-cli/pull/289#discussion_r288472614:

@@ -39,6 +39,14 @@ module.exports = function(gulp, config) { 'include css': true }, config.stylus | {})

  • var sassOptions = {}
  • if(config.sassNodeModulesAlias) {
  • var sassOptions = assign({}, sassOptions, {

Yeah typo

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/manGoweb/mango-cli/pull/289?email_source=notifications&email_token=ABAVVARXJOGPNNQP3ZJYIBTPXZDO5A5CNFSM4HQBOAP2YY3PNVWWK3TUL52HS4DFWFIHK3DMKJSXC5LFON2FEZLWNFSXPKTDN5WW2ZLOORPWSZGOBZ672RQ#discussion_r288472614, or mute the thread https://github.com/notifications/unsubscribe-auth/ABAVVAV6E6P3JT3LV3YFZY3PXZDO5ANCNFSM4HQBOAPQ .