Skip to content

Commit 67f26a5

Browse files
committed
updating id generation to make it compatible with differnt server environments
1 parent d03c50f commit 67f26a5

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

packages/ink/src/compiler/Component.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,14 @@ export default class Component {
207207
* is fixed length.
208208
*/
209209
public get id() {
210-
return serialize(this.relative);
210+
//get the relative path
211+
let relative = this.relative;
212+
//if this is a node modules
213+
if (relative.includes('node_modules/')) {
214+
//remove the left side of the path
215+
relative = relative.split('node_modules/')[1];
216+
}
217+
return serialize(relative);
211218
}
212219

213220
/**
@@ -306,7 +313,7 @@ export default class Component {
306313
}
307314

308315
/**
309-
* Returns the source code
316+
* Returns the original source path
310317
*/
311318
public get source() {
312319
return this._source;

0 commit comments

Comments
 (0)