Skip to content

Commit d07f89f

Browse files
ccntrqMartynas Žilinskas
authored andcommitted
fix: consider projectDirectory in tildeImporter (#50)
1 parent 257b10c commit d07f89f

4 files changed

Lines changed: 7 additions & 5 deletions

File tree

dist/launcher.js

Lines changed: 3 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "scss-bundle",
3-
"version": "2.3.1",
3+
"version": "2.3.2",
44
"description": "Bundling SCSS files to one bundled file.",
55
"types": "@types/index.d.ts",
66
"main": "index.js",

src/launcher.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,8 @@ export class Launcher {
107107

108108
private tildeImporter: nodeSass.Importer = (url: string) => {
109109
if (url[0] === "~") {
110-
const filePath = path.resolve("node_modules", url.substr(1));
110+
const projectDirectory = this.config.ProjectDirectory ? this.config.ProjectDirectory : ".";
111+
const filePath = path.resolve(projectDirectory + "/node_modules", url.substr(1));
111112
return { file: filePath };
112113
}
113114
return { file: url };

0 commit comments

Comments
 (0)