maoberlehner / node-sass-magic-importer

Custom node-sass importer for selector specific imports, module importing, globbing support and importing files only once.
MIT License
292 stars 28 forks source link

Import from dist instead of from src #194

Closed walkerburgin closed 5 years ago

walkerburgin commented 5 years ago

I ran into an issue trying to update a project which depends on node-sass-package-importer to use TypeScript's project references:

error TS6307: File '<project>/node_modules/node-sass-magic-importer/src/interfaces/IImporterOptions.ts' is not in project file list. Projects must list all files or use an 'include' pattern.

Looking at the output of --traceResolution, I believe this is happening because a source file file is accidentally being imported instead of the compiled .js/.dts:

======== Resolving module 'node-sass-magic-importer/src/interfaces/IImporterOptions' from '<project>/node_modules/node-sass-package-importer/dist/index.d.ts'. ========
Explicitly specified module resolution kind: 'NodeJs'.
Loading module 'node-sass-magic-importer/src/interfaces/IImporterOptions' from 'node_modules' folder, target file type 'TypeScript'.
Directory '<project>/node_modules/node-sass-package-importer/dist/node_modules' does not exist, skipping all lookups in it.
Directory '<project>/node_modules/node-sass-package-importer/node_modules' does not exist, skipping all lookups in it.
'package.json' does not have a 'typesVersions' field.
Found 'package.json' at '<project>/node_modules/node-sass-magic-importer/package.json'. Package ID is 'node-sass-magic-importer/src/interfaces/IImporterOptions/index.d.ts@5.2.0'.
File '<project>/node_modules/node-sass-magic-importer/src/interfaces/IImporterOptions.ts' exist - use it as a name resolution result.
Resolving real path for '/<project>/node_modules/node-sass-magic-importer/src/interfaces/IImporterOptions.ts', result '<project>/node_modules/node-sass-magic-importer/src/interfaces/IImporterOptions.ts'.
======== Module name 'node-sass-magic-importer/src/interfaces/IImporterOptions' was successfully resolved to '<project>/node_modules/node-sass-magic-importer/src/interfaces/IImporterOptions.ts'. ========
coveralls commented 5 years ago

Coverage Status

Coverage remained the same at 100.0% when pulling a074bccf38c8797597f0db7fed5dbcc7f85bcd39 on walkerburgin:master into 4f439f2a0f7a8f52b58ff9986ce006b36e2f4789 on maoberlehner:master.

coveralls commented 5 years ago

Coverage Status

Coverage remained the same at 100.0% when pulling a074bccf38c8797597f0db7fed5dbcc7f85bcd39 on walkerburgin:master into 4f439f2a0f7a8f52b58ff9986ce006b36e2f4789 on maoberlehner:master.

maoberlehner commented 5 years ago

Hey @walkerburgin!

Thank you for your contribution. I can remember that I already had problems with src/ and dist/ but I can't remember the details. I'll take a closer look the next couple of days and try to remember why and what I did the last time. Thx!

walkerburgin commented 5 years ago

Friendly ping, any luck with this?

walkerburgin commented 5 years ago

Thank you!