What are the options that addDependency takes?
It isn't really relevant, but I'm trying to write a plugin, and it goes something like this…
I'm a bit in the same situation and my findings are:
addDependency with or without includedInParent option:
addDependency(path)and rebuild the aformentioned Asset when it changes.
addDependency(path, { includedInParent: true })
path rules
path should be a relative path following require rules (e.g. ./foo.ext); it can't be absolute.
path can be a specific file or a "glob" pattern (e.g. **/*.ext), in which case:
includedInParent, every single file matching the glob will be bundled and watched individually,includedInParent, the glob path will be watched BUT it will fail to get the parent rebuilt because of bug #2483For your project I suppose you should define a MapAsset for .map files extending JSAsset, overload the load method to produce JS including the .set files. Individual .set file should be linked as includedInParent dependencies of the MapAsset, and the generated JS would refer to the images using relative require calls.
Most helpful comment
I'm a bit in the same situation and my findings are:
addDependencywith or withoutincludedInParentoption:addDependency(path)and rebuild the aformentioned Asset when it changes.
addDependency(path, { includedInParent: true })pathrulespathshould be a relative path followingrequirerules (e.g../foo.ext); it can't be absolute.pathcan be a specific file or a "glob" pattern (e.g.**/*.ext), in which case:includedInParent, every single file matching the glob will be bundled and watched individually,includedInParent, the glob path will be watched BUT it will fail to get the parent rebuilt because of bug #2483For your project I suppose you should define a
MapAssetfor.mapfiles extendingJSAsset, overload theloadmethod to produce JS including the.setfiles. Individual.setfile should be linked asincludedInParentdependencies of theMapAsset, and the generated JS would refer to the images using relativerequirecalls.