-
Notifications
You must be signed in to change notification settings - Fork 75
Open
Description
Problem/motivation
I would like to include twig files outside the project path, but currently it’s not possible, because twig resolves to wrong path with those files.
An example:
Root for project where I use twig-loader is /some/path/my_project.
I can import twig file from /some/path/my_project/templates/template.twig.
I can’t import twig file from /some/path/templates/template.twig and will get an error like:
ERROR in ../templates/template.twig
Module not found: Error: Can't resolve 'twig' in ‘/some/path/my_project’
@ ../templates/template.twig 3:11-26
…
Proposed resolution
Use stringifyRequest (https://github.com/webpack/loader-utils#stringifyrequest) from loader-utils to get path to twig in https://github.com/zimmo-be/twig-loader/blob/master/lib/loader.js#L33.
jnowland, ben-rogerson, mahapo, ziaenezhad, pchr-srf and 1 more
Metadata
Metadata
Assignees
Labels
No labels