Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document how to map external less files #1493

Closed
thelgevold opened this issue Jul 29, 2016 · 9 comments
Closed

Document how to map external less files #1493

thelgevold opened this issue Jul 29, 2016 · 9 comments
Labels
P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent type: RFC / discussion / question

Comments

@thelgevold
Copy link
Contributor

thelgevold commented Jul 29, 2016

I am requesting documentation on how to map to imported less files in the webpack version of CLI.

In the previous version there was a hook in angular-cli.builds.js to specify paths for the lessCompiler:

lessCompiler: {
      paths: ['node_modules/some-path/less']
    }

angular-cli.builds.js is no longer included in the version on master.

It works to specify less files in styleUrls, but I am not able to import other less files from my component less files.

@filipesilva
Copy link
Contributor

Possibly related #1465

I don't have an answer for this at the moment. @TheLarkInn can you advise if there's a solution right now?

@TheLarkInn
Copy link
Member

Yeah its related overall. @thelgevold we need to make essentially a property that allows this for all the preprocessers we support (behind the scenes).

@thelgevold
Copy link
Contributor Author

Thanks @TheLarkInn .
I wonder if there might be a similar issue when dealing with paths in tsconfig.json.

paths was added in TS 1.9 and is a way to create an alias to avoid long relative import paths.

If I run tsc my code compiles, but during ng build I get module not found errors, so I suspect the paths have to be "ferried" into the webpack world somehow?

@sirajc
Copy link

sirajc commented Jul 29, 2016

Maybe, mapping paths of tsconfig to resolve.alias of webpack

@clydin
Copy link
Member

clydin commented Aug 4, 2016

@thelgevold The webpack specific method is to prefix the name of the package with a ~.
For example, @import "~some-path/less/file";
This is probably not the long-term solution, but might get you up and running.

@TheLarkInn
Copy link
Member

Yeah this is great in webpack land but not user land.

@clydin
Copy link
Member

clydin commented Aug 4, 2016

For sass/scss, there is https://github.com/lucasmotta/sass-module-importer. It supports reading a module's package.json which allows a simple @import "<package-name>". This would allow sass/scss to mimic the typescript workflow of npm install and import.

@filipesilva filipesilva added feature: webpack P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent labels Aug 10, 2016
@filipesilva
Copy link
Contributor

Supersedes by #1791, work in progress on #2747

@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 6, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent type: RFC / discussion / question
Projects
None yet
Development

No branches or pull requests

5 participants