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

Feat: Replace node-sass with Dart sass #30

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"dependencies": {
"cssmin": "^0.4.3",
"minimist": "^1.2.0",
"node-sass": "^3.1.2, ^4.0.0"
"sass": "^1.43.3"
},
"devDependencies": {
"cross-spawn": "2.0.0",
Expand Down
2 changes: 1 addition & 1 deletion src/compile.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use strict';

var sass = require('node-sass');
var sass = require('sass');
var cssmin = require('cssmin');

function wrapValue(value) {
Expand Down
8 changes: 4 additions & 4 deletions test/compileTests.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ var sinon = require('sinon');
describe('Compile', function() {
var correctlyWrapped;
var minifiedWrapped;
var nodeSassStub;
var sassStub;
var cssminStub;
var Compile;
var scssString;
Expand All @@ -16,13 +16,13 @@ describe('Compile', function() {
scssString = '1px solid blue';
correctlyWrapped = '.test { content: ' + scssString + ' };';
minifiedWrapped = '.test{content:' + scssString + '}';
nodeSassStub = {
sassStub = {
renderSync: sinon.stub().returns({ css: correctlyWrapped })
};
cssminStub = sinon.stub().returns(minifiedWrapped);

Compile = proxyquire('../src/compile', {
'node-sass': nodeSassStub,
'sass': sassStub,
'cssmin': cssminStub
});
});
Expand All @@ -47,7 +47,7 @@ describe('Compile', function() {
it('returns the compiled scss given to it as an argument', function() {
var compiled = Compile.fromString(scssString);

assert.ok(nodeSassStub.renderSync.calledWith({ data: correctlyWrapped }));
assert.ok(sassStub.renderSync.calledWith({ data: correctlyWrapped }));
assert.ok(cssminStub.calledWith(correctlyWrapped));
assert.strictEqual(compiled, scssString);
});
Expand Down
Loading