Giter Club home page Giter Club logo

Comments (4)

maxlllll avatar maxlllll commented on August 16, 2024 1

hey @ahmadawais @asharirfan could you explain how to customize the configs to make image import work? I tried to integrate some loaders into the webpack.config.dev.js , but the compiler continues to fail when I start the "npm start" in "my-block". It seems I look at the wrong place, as none of the changes affects the compiling fail, (not even deleting the webpack.config.dev.js)

My goal is to place a static image file in a block, just like Jason.
So I placed an image within the block folder:
my-block/src/block/images/image.png
and try to import it to the block.js via
import image from './images/image.png'
and use it in the EDIT section
<img src={image} />

from create-guten-block.

asharirfan avatar asharirfan commented on August 16, 2024

Hey @jasonbahl 🙌

👉 Webpack config for create-guten-block is handled by cgb-scripts in here: https://github.com/ahmadawais/create-guten-block/tree/master/packages/cgb-scripts/config

You can customize the configs in this script to start supporting image imports.

✅ Image optimization is also in our goals for v2.0 #11

Cheers! 🥂

from create-guten-block.

ahmadawais avatar ahmadawais commented on August 16, 2024

@jasonbahl Image manipulation is a bit tricky since it has to do with WordPress generating the URL and webpack having the knowledge of that part. Maybe, the best way to move forward would be building a webpack-wp-image-loader.

Do you have the example for me where you're using the images and how? It will help me understand the usecase. Also would love your help with a PR for this one.

from create-guten-block.

ahmadawais avatar ahmadawais commented on August 16, 2024

@jasonbahl Can I get a final answer from you on this issue. Would you like to contribute this part? 🤔

from create-guten-block.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.