Easiest way is to put this in your build script: find path/to/package -name '*.d' | \ xargs grep '^module ' | \ sed 's,^module,import,' \ > data/modules.d Add `-J data` to your DMD command line, or add `"stringImportPaths": ["data"]` to dub.json. Then in your file: mixin(import("modules.d"));