Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
node-sass
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
楚学文
node-sass
Commits
5ab23fb3
Commit
5ab23fb3
authored
Jan 01, 2015
by
vagrant
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
CLI: Makes compilation data-first.
* Other minor fixes.
parent
5dd70318
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
9 deletions
+7
-9
node-sass
bin/node-sass
+3
-5
render.js
lib/render.js
+3
-3
my_custom_importer_file.js
test/fixtures/extras/my_custom_importer_file.js
+1
-1
No files found.
bin/node-sass
View file @
5ab23fb3
...
@@ -5,8 +5,7 @@ var Emitter = require('events').EventEmitter,
...
@@ -5,8 +5,7 @@ var Emitter = require('events').EventEmitter,
meow
=
require
(
'meow'
),
meow
=
require
(
'meow'
),
replaceExt
=
require
(
'replace-ext'
),
replaceExt
=
require
(
'replace-ext'
),
stdin
=
require
(
'get-stdin'
),
stdin
=
require
(
'get-stdin'
),
render
=
require
(
'../lib/render'
),
render
=
require
(
'../lib/render'
);
fs
=
require
(
'fs'
);
/**
/**
* Initialize CLI
* Initialize CLI
...
@@ -209,11 +208,10 @@ function run(options, emitter) {
...
@@ -209,11 +208,10 @@ function run(options, emitter) {
}
}
if
(
options
.
importer
)
{
if
(
options
.
importer
)
{
if
(
fs
.
existsSync
(
options
.
importer
))
{
if
(
(
path
.
resolve
(
options
.
importer
)
===
path
.
normalize
(
options
.
importer
).
replace
(
/
(
.+
)([\/
|
\\])
$/
,
'$1'
)
))
{
options
.
importer
=
require
(
options
.
importer
);
options
.
importer
=
require
(
options
.
importer
);
}
else
{
}
else
{
console
.
error
(
'Could not locate importer.'
);
options
.
importer
=
require
(
path
.
resolve
(
process
.
cwd
(),
options
.
importer
));
process
.
exit
(
1
);
}
}
}
}
...
...
lib/render.js
View file @
5ab23fb3
...
@@ -26,10 +26,10 @@ module.exports = function(options, emitter) {
...
@@ -26,10 +26,10 @@ module.exports = function(options, emitter) {
importer
:
options
.
importer
importer
:
options
.
importer
};
};
if
(
options
.
src
)
{
if
(
options
.
data
)
{
renderOptions
.
file
=
options
.
src
;
}
else
if
(
options
.
data
)
{
renderOptions
.
data
=
options
.
data
;
renderOptions
.
data
=
options
.
data
;
}
else
if
(
options
.
src
)
{
renderOptions
.
file
=
options
.
src
;
}
}
renderOptions
.
success
=
function
(
result
)
{
renderOptions
.
success
=
function
(
result
)
{
...
...
test/fixtures/extras/my_custom_importer_file.js
View file @
5ab23fb3
var
path
=
require
(
'path'
);
var
path
=
require
(
'path'
);
module
.
exports
=
function
(
file
)
{
console
.
log
(
'>>>>>>>>>>'
);
console
.
log
(
path
.
resolve
(
path
.
join
(
process
.
cwd
(),
'test/fixtures/include-files/'
,
file
+
(
path
.
extname
(
file
)
?
''
:
'.scss'
))));
module
.
exports
=
function
(
file
)
{
return
{
return
{
file
:
path
.
resolve
(
path
.
join
(
process
.
cwd
(),
'test/fixtures/include-files/'
,
file
+
(
path
.
extname
(
file
)
?
''
:
'.scss'
)))
file
:
path
.
resolve
(
path
.
join
(
process
.
cwd
(),
'test/fixtures/include-files/'
,
file
+
(
path
.
extname
(
file
)
?
''
:
'.scss'
)))
};
};
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment