Skip to content

Commit 3d81d25

Browse files
committed
Add sourcemap suppport
1 parent 6d853c5 commit 3d81d25

File tree

1 file changed

+9
-10
lines changed

1 file changed

+9
-10
lines changed

django_esm/finders.py

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -35,18 +35,17 @@ def find(self, path, all=False):
3535
return [] # this method has a strange return type
3636

3737
def list(self, ignore_patterns):
38-
return self._list(*ignore_patterns)
39-
40-
@staticmethod
41-
@functools.lru_cache()
42-
def _list(*ignore_patterns):
4338
with (settings.BASE_DIR / "package.json").open() as f:
4439
package_json = json.load(f)
45-
return [
46-
(path, storages.root_storage)
47-
for mod, path in utils.parse_root_package(package_json)
48-
if not matches_patterns(path, ignore_patterns)
49-
]
40+
for mod, path in utils.parse_root_package(package_json):
41+
if not matches_patterns(path, ignore_patterns):
42+
yield path, storages.root_storage
43+
map_path = settings.BASE_DIR / path
44+
map_path = map_path.with_suffix(map_path.suffix + ".map")
45+
if map_path.exists():
46+
yield str(
47+
map_path.relative_to(settings.BASE_DIR)
48+
), storages.root_storage
5049

5150
@functools.cached_property
5251
def all(self):

0 commit comments

Comments
 (0)