Skip to content

Conversation

astappiev
Copy link
Contributor

As described in #61, even after moving node-sass to optional dependencies it is still downloaded by npm/yarn.

Moving it to peer dependencies solves the issue.
Now users have to specify what package they want to use sass or node-sass in their projects.

@astappiev
Copy link
Contributor Author

Ok, peerDependencies downloaded too.

So, if we want to avoid node-sass and sass installed at the same time, we have to remove them :/

@andreimoment
Copy link

Does this mean that mom install sass --dev is sufficient to replace node-sass with sass?

Or, is there an option to specify the sass engine to be used?

@astappiev
Copy link
Contributor Author

Yes, you have to install rollup-plugin-scss and sass (or node-sass).

Like one of:

  • npm install rollup-plugin-scss sass --save-dev
  • npm install rollup-plugin-scss node-sass --save-dev

Until this is merged, you can try

  • npm install @astappiev/rollup-plugin-scss sass --save-dev

@andreimoment
Copy link

andreimoment commented Feb 6, 2021 via email

@astappiev
Copy link
Contributor Author

rollup-plugin-scss will not use sass automatically until this PR is merged and a new version released. There is workaround like setting sass in configuration (like sass: require('sass'),), but it will anyway install node-sass even if not used.

If you use my patched version @astappiev/rollup-plugin-scss, you can verify that node-sass doesn't exist in node_modules directory.

@thgh thgh mentioned this pull request Feb 7, 2021
15 tasks
Base automatically changed from master to v2 February 7, 2021 13:49
Copy link
Owner

@thgh thgh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you mind updating the README?

@astappiev
Copy link
Contributor Author

Done

@EtienneBruines
Copy link

EtienneBruines commented Feb 10, 2021

It is nice that for v3, the dependency is being removed completely. Just a quick question here:

In v2.6.1, the dependency was already moved towards optionalDependencies -- yet the npm release still includes it under dependencies.

Did something go wrong with the deployment, causing the discrepancy?

From the downloaded package.json:

{
  "_resolved": "https://registry.npmjs.org/rollup-plugin-scss/-/rollup-plugin-scss-2.6.1.tgz",
  "dependencies": {
    "node-sass": "4",
    "rollup-pluginutils": "2"
  },
  "optionalDependencies": {
    "node-sass": "4"
  },
}

@thgh
Copy link
Owner

thgh commented Feb 11, 2021

Seems to be a "feature": npm/npm#3502

@thgh thgh changed the base branch from v2 to v3 February 11, 2021 07:44
@andreimoment
Copy link

  1. Thank you for the great work with this plugin. Now that I am running @astappiev/rollup-plugin-scss version, dart-sass compilation is instantaneous. This is the fastest scss development I've ever experienced and a huge improvement from sassc. And, it watches the whole tree (If you look at the snowpack plugin you'll see they're having issues with this part).
  2. When can I replace this version with the stock version in my installation? Has v3 been released?

@thgh thgh merged commit 5c4a25d into thgh:v3 Feb 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants