You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have searched the issues / PRs and cannot find something to help support what I need. I am happy to open a PR if someone can point me in the correct direction.
🙋 feature request
I want to be able to split my assets up by type into two separate folders, without the Namer changing paths.
This is because files under template will be deployed to a server application and files under static will be deployed to a CDN.
Another way to view this - after the Namer, Optimizesr, Compressors run, partition the files into two folders based on bundle type without changing the name.
🤔 Expected Behavior
Naming assets (in a Namer plugin) is separate from placing them in the output directory (e.g. support a subdir without changing all the paths).
😯 Current Behavior
The name is the path on disk and the reference in other assets (e.g. src="...")
💁 Possible Solution
As far as I am aware, this cannot be done now. I was thinking of changing the Namer contract to return either a FilePath string or an object of the structure:
To support existing behviour (where these are the same) and new behaviour (where these can be different).
🔦 Context
I am using Parcel to develop HTML templates. The template files I write reference JS, CSS, and other types of assets relatively. Parcel then processes these Templates to resolve references to assets and point to now bundled/built assets. The problem is that Templates are shipped in a different way than static files - the former are injected into a server application and the latter are deployed on a CDN.
The text was updated successfully, but these errors were encountered:
sdedovic
changed the title
Namer Plugins - Separate naming from output file path
Namer Plugins - Separate naming from on-disk file path
Oct 15, 2024
sdedovic
changed the title
Namer Plugins - Separate naming from on-disk file path
Namer Plugins - Separate naming process from on-disk file path
Oct 15, 2024
While the above works, it doesn't completely solve the problem. I still have no way to put the other assets into a subdirectory of dist-dir without the paths in files being borked. Second, I can no longer have a source directory called templates as the name will conflict.
Would you consider my above possible solution? Or potentially a plugin type that runs after all other plugins simply to persist files without other side effects (like Namer plugins have)?
I have searched the issues / PRs and cannot find something to help support what I need. I am happy to open a PR if someone can point me in the correct direction.
🙋 feature request
I want to be able to split my assets up by type into two separate folders, without the Namer changing paths.
This is because files under
template
will be deployed to a server application and files understatic
will be deployed to a CDN.Another way to view this - after the Namer, Optimizesr, Compressors run, partition the files into two folders based on bundle type without changing the name.
🤔 Expected Behavior
Naming assets (in a Namer plugin) is separate from placing them in the output directory (e.g. support a subdir without changing all the paths).
😯 Current Behavior
The name is the path on disk and the reference in other assets (e.g.
src="..."
)💁 Possible Solution
As far as I am aware, this cannot be done now. I was thinking of changing the
Namer
contract to return either aFilePath
string or an object of the structure:To support existing behviour (where these are the same) and new behaviour (where these can be different).
🔦 Context
I am using Parcel to develop HTML templates. The template files I write reference JS, CSS, and other types of assets relatively. Parcel then processes these Templates to resolve references to assets and point to now bundled/built assets. The problem is that Templates are shipped in a different way than static files - the former are injected into a server application and the latter are deployed on a CDN.
💻 Examples
Currently I am doing this manually,
The text was updated successfully, but these errors were encountered: