diff --git a/src/compiler/sys/typescript/tests/typescript-sys.spec.ts b/src/compiler/sys/typescript/tests/typescript-sys.spec.ts index 608993dc7a8..4af10e98ad3 100644 --- a/src/compiler/sys/typescript/tests/typescript-sys.spec.ts +++ b/src/compiler/sys/typescript/tests/typescript-sys.spec.ts @@ -9,23 +9,23 @@ describe('getTypescriptPathFromUrl', () => { }; it('not typescript, return url', () => { - const tsExecutingUrl = 'https://cdn.jsdelivr.net/npm/typescript@3.8.3/lib/typescript.js'; + const tsExecutingUrl = 'https://cdn.jsdelivr.net/npm/@stencil/core@2.0.0/compiler/stencil.js'; const url = 'https://cdn.jsdelivr.net/npm/something/index.js'; const r = getTypescriptPathFromUrl(config, tsExecutingUrl, url); expect(r).toBe('https://cdn.jsdelivr.net/npm/something/index.js'); }); it('ts path from url, version', () => { - const tsExecutingUrl = 'https://cdn.jsdelivr.net/npm/typescript@3.8.3/lib/typescript.js'; - const url = 'https://cdn.jsdelivr.net/npm/typescript@3.8.3/lib/lib.es2015.proxy.d.ts'; + const tsExecutingUrl = 'https://cdn.jsdelivr.net/npm/@stencil/core@2.0.0/compiler/stencil.js'; + const url = 'https://cdn.jsdelivr.net/npm/@stencil/core@2.0.0/compiler/lib.es2015.proxy.d.ts'; const r = getTypescriptPathFromUrl(config, tsExecutingUrl, url); - expect(r).toBe('/some/path/node_modules/typescript/lib/lib.es2015.proxy.d.ts'); + expect(r).toBe('/some/path/node_modules/@stencil/core/compiler/lib.es2015.proxy.d.ts'); }); it('ts path from url, no version', () => { - const tsExecutingUrl = 'https://cdn.jsdelivr.net/npm/typescript/lib/typescript.js'; - const url = 'https://cdn.jsdelivr.net/npm/typescript/lib/lib.es2015.proxy.d.ts'; + const tsExecutingUrl = 'https://cdn.jsdelivr.net/npm/@stencil/core/compiler/stencil.js'; + const url = 'https://cdn.jsdelivr.net/npm/@stencil/core/compiler/lib.es2015.proxy.d.ts'; const r = getTypescriptPathFromUrl(config, tsExecutingUrl, url); - expect(r).toBe('/some/path/node_modules/typescript/lib/lib.es2015.proxy.d.ts'); + expect(r).toBe('/some/path/node_modules/@stencil/core/compiler/lib.es2015.proxy.d.ts'); }); }); diff --git a/src/compiler/sys/typescript/typescript-sys.ts b/src/compiler/sys/typescript/typescript-sys.ts index 79186848ba6..f3150f74cca 100644 --- a/src/compiler/sys/typescript/typescript-sys.ts +++ b/src/compiler/sys/typescript/typescript-sys.ts @@ -186,7 +186,7 @@ export const getTypescriptPathFromUrl = (config: d.Config, tsExecutingUrl: strin const tsBaseUrl = new URL('..', tsExecutingUrl).href; if (url.startsWith(tsBaseUrl)) { const tsFilePath = url.replace(tsBaseUrl, '/'); - const tsNodePath = config.sys.getLocalModulePath({ rootDir: config.rootDir, moduleId: 'typescript', path: tsFilePath }); + const tsNodePath = config.sys.getLocalModulePath({ rootDir: config.rootDir, moduleId: '@stencil/core', path: tsFilePath }); return normalizePath(tsNodePath); } return url;