linkedin / linkedin/eyeglass

importing specific file from lib

Open
#184 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

package:eyeglass
Dominant language
TypeScript
Stars
738
Forks
48
PR merge metrics
No merged PRs in 30d

Description

I'm currently having a big problem here.
From what I'm gathering from the documentation, I _should_ be able to import a specific file inside an eyeglass module:

> If your build-tool is eyeglass-aware, you can reference the eyeglass module with standard Sass import syntax: `@import "my_eyeglass_module/file";`. The `my_eyeglass_module` will be resolved to the correct directory in your node modules, and the file will then resolve using the standard import rules for Sass.

Unfortunately this doesn't seem the case, or at least I have no idea how to configure the module in order to be able to do so.

If my module has the following directory structure:

```
/sass/
_index.scss
_color.scss
```

if I try to do `@include "my_eyeglass_module";` works without problems, but `@include "my_eyeglass_module/color";` fails miserably with an error repeated 4 times:

```
Message:
src/sass/abstracts/_color.scss
Error: Error: Could not import my_eyeglass_module/color from any of the following locations:
...... (all relative directories inside the current project)
on line 1 of src/sass/abstracts/_color.scss
from line 11 of src/sass/main.scss
>> @import 'my_eyeglass_module/color';
```

Even trying to help it a little bit more seems useless, `@include "my_eyeglass_module/sass/color";` yields the very same sequence of repeated errors.

What am I doing wrong here?
Any help is _greatly_ appreciated before I lose my sanity :)

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Use the reported /sass/_index.scss and _color.scss structure as the reproduction, beginning with the imports in src/sass/abstracts/_color.scss and src/sass/main.scss. Confirm that the module-specific import path resolves to _color.scss instead of producing the repeated lookup error.

Written by the indexing model from the issue text.

Assessment

Domain
frontend, web-dev
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.