Skip to content

Commit 5b93641

Browse files
authored
Merge pull request #1175 from IgniteUI/simeonoff/fix-samples-browser
fix: update Transformer.ts and webpack.config.js
2 parents 62090f5 + 2fd964a commit 5b93641

4 files changed

Lines changed: 14 additions & 63 deletions

File tree

browser/tasks/Transformer.ts

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -585,15 +585,10 @@ class Transformer {
585585
}
586586
}
587587

588-
public static getRelative(path: string): string {
589-
if (path.indexOf(igConfig.RepositoryName) > -1) {
590-
path = path.split(igConfig.RepositoryName).pop() as string;
591-
path = path.split("\\").join("/");
592-
return "." + path;
593-
}
594-
595-
console.log("failed on getRelative " + path);
596-
return path;
588+
public static getRelative(absolutePath: string): string {
589+
let relative = require('path').relative(process.cwd(), absolutePath);
590+
relative = relative.split("\\").join("/");
591+
return "./" + relative;
597592
}
598593

599594
public static getFileName(relativePath: string): string {

package-lock.json

Lines changed: 1 addition & 52 deletions
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
@@ -102,7 +102,7 @@
102102
"marked-shiki": "^1.2.0",
103103
"postcss-loader": "^8.1.1",
104104
"rimraf": "^2.6.1",
105-
"sass": "^1.96.0",
105+
"sass-embedded": "^1.92.1",
106106
"sass-loader": "^16.0.6",
107107
"shiki": "^3.0.0",
108108
"source-map-loader": "^0.2.1",

webpack.config.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,8 +145,9 @@ var config = {
145145
{
146146
loader: 'sass-loader',
147147
options: {
148+
implementation: require('sass-embedded'),
148149
sassOptions: {
149-
silenceDeprecations: ['color-functions', 'if-function'],
150+
silenceDeprecations: ['color-functions'],
150151
loadPaths: [
151152
path.resolve(__dirname, 'node_modules'),
152153
]
@@ -173,6 +174,12 @@ var config = {
173174
})]
174175
},
175176
plugins: plugins,
177+
watchOptions: {
178+
ignored: [
179+
'**/node_modules',
180+
path.resolve(__dirname, 'samples'),
181+
],
182+
},
176183
devServer: {
177184
static: path.join(__dirname, 'browser/dist/'),
178185
compress: true,

0 commit comments

Comments
 (0)