Giter VIP home page Giter VIP logo

Comments (4)

zwhitchcox avatar zwhitchcox commented on May 30, 2024 1

Oh sorry, this was fixed by the previous comment

from url-loader.

zwhitchcox avatar zwhitchcox commented on May 30, 2024

So, now, when I type <img src={require('./image.png')} /> webpack just dies. This is the error it gives me.

npm ERR! Linux 3.8.11
npm ERR! argv "/usr/bin/iojs" "/usr/local/bin/npm" "start"
npm ERR! node v5.0.0
npm ERR! npm  v3.3.6
npm ERR! code ELIFECYCLE
npm ERR! @ start: `webpack-dev-server --hot --inline --history-api-fallback`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the @ start script 'webpack-dev-server --hot --inline --history-api-fallback'.
npm ERR! This is most likely a problem with the  package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     webpack-dev-server --hot --inline --history-api-fallback
npm ERR! You can get their info via:
npm ERR!     npm owner ls
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /home/zane/3ashworth/npm-debug.log

from url-loader.

Mike-Sinistralis avatar Mike-Sinistralis commented on May 30, 2024

Using ES6 and JSX, you should be able to do:

import someVar from 'imgPath'

<img src={someVar} />

from url-loader.

michael-ciniawsky avatar michael-ciniawsky commented on May 30, 2024

@zwhitchcox Please provide more info about your setup (webpack.config.js). E.g is the <img src={require('image.png')} /> inside a .js or .html file (requires another loader) ?

from url-loader.

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.