dojo / cli-build-app

Command for building Dojo applications
Other
9 stars 32 forks source link

dts loader uses presence of `src/` in directory path to determine whether to modify files #369

Closed maier49 closed 4 years ago

maier49 commented 4 years ago

Bug

Package Version:

Expected behavior:

Style .dts files for external dependencies should not be modified, regardless of where the file lives

Actual behavior: They are modified

msssk commented 4 years ago

Correct me if I'm wrong @maier49, but just trying to add some clarity - this is related to CSS module .d.ts files being overwritten, right?

What's happening is that during a build for an application that uses @dojo/widgets some of the CSS module .d.ts files in node_modules/@dojo/widgets are being regenerated. I would think this should never happen; in my case it's worse because the files are being overwritten with no content, so I'm left with empty .d.ts files which breaks subsequent builds.

The reason it happens is because the build tool does a simple check for src anywhere within the CSS file's path, intending to only match project/src/**/*.m.css. Unfortunately this also matches src/project/**/*.m.css, including src/project/node_modules/@dojo/widgets/**/*.m.css