Comments (5)
Hello,
When you import a static file like
import svgURL from '../static/mystuff.svg'
It is automatically copied to the /dist
during build. So you don't have to change paths or copy anything. You just need to make sure you have proper loader for the type of file you are importing.
from wp-webpack-script.
Ok great ! And what i have to write in HTML files when i want to display an image ?
from wp-webpack-script.
Hello,
Sorry for not being clear. The above is what you'd do in a JS file. For HTML or PHP, you have rely on server side logic to get the static asset. This library is for managing front-end things only.
from wp-webpack-script.
@swashata ? Makes no sense. I'd like some help on this one as well; "How can one fetch a static asset, like an image, in the HTML?"
from wp-webpack-script.
This seems to do the trick: swashata/wpackio-enqueue#4
from wp-webpack-script.
Related Issues (20)
- The manifest.json file updates without running build HOT 6
- Caching Plugins and ContentHash HOT 6
- Dependency Dashboard
- Asset name with ~ (6G Firewall - 403 error) HOT 3
- Issue with JSX? HOT 2
- Recipe for SSG / Static html generation and preload HOT 3
- 403 Forbidden on vendors script file HOT 1
- Strange enqueue behaviour, with nothing being enqueued at all. Needs fix in Enqueue.php:297 source HOT 2
- Shortcode params HOT 1
- [fork-ts-checker-webpack-plugin] breaking change in 7.0 HOT 1
- bannerConfig should not default if not filled, it should be left out
- Typescript not working HOT 6
- wpack project in subdirectory results in broken asset paths
- update to webpack 5 HOT 3
- Conflict with React Router 6
- Conflicting file-loader documentation
- Wp
- How to make server works on docker
- Is this project dead? HOT 4
- Not able to setup site on the local system. HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from wp-webpack-script.