-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Open
Labels
[Type] Build ToolingIssues or PRs related to build toolingIssues or PRs related to build tooling[Type] EnhancementA suggestion for improvement.A suggestion for improvement.
Description
What problem does this address?
WP Build should support importing images and converting them to asset paths:
import image from './image.png';
const Example () => (
<img src={ image } />
);There might not be a need at the moment in Gutenberg for this, but for plugins using the build tool, this would be a fairly basic feature to support. Otherwise, it becomes harder to point to the right image path on the server from React components.
What is your proposed solution?
Adding Asset modules into the WP Build package.
Features:
- It would be great if this supports PNG, GIF, JPG, and svg files.
- Images would get cache-busted between builds using hashes.
- WP Build would take care of configuring a publicly accessible path for images in
buildfolder.
Here's an example from Jetpack plugin's build tool: file rule and docs.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
[Type] Build ToolingIssues or PRs related to build toolingIssues or PRs related to build tooling[Type] EnhancementA suggestion for improvement.A suggestion for improvement.