Giter VIP home page Giter VIP logo

Comments (5)

sokra avatar sokra commented on May 30, 2024

stats.modules[x].assets

from url-loader.

iam4x avatar iam4x commented on May 30, 2024

@sokra

Let's say I have this:

<img src={require('react-logo.png')} />

In my stats.json if I search for react-logo there's no results. I want to map the original filename to the generated one.

To achieve something like that:

{
  'react-logo.png': '28D983jdui.png'
}

Or am I thinking in the wrong way?

from url-loader.

sokra avatar sokra commented on May 30, 2024

in stats.modules you have all modules in this format:

{
    id: 11,
    identifier: "...\\node_modules\\file-loader\\index.js!...\\test\\browsertest\\img\\image.png",
    name: "(webpack)/~/file-loader!./img/image.png",
    size: 81,
    cacheable: true,
    built: true,
    optional: false,
    prefetched: false,
    chunks: [0],
    assets: ["c31e9820c001c9c4a86bce33ce43b679.png"],
    issuer: "...\\test\\browsertest\\lib\\index.web.js",
    profile: {
        factory: 245,
        building: 121
    },
    failed: false,
    errors: 0,
    warnings: 0,
    reasons: [
        {
            moduleId: 0,
            moduleIdentifier: "...\\test\\browsertest\\lib\\index.web.js",
            module: "./lib/index.web.js",
            moduleName: "./lib/index.web.js",
            type: "cjs require",
            userRequest: "!file!../img/image.png",
            loc: "105: 3-36"
        }
    ],
    source: 'module.exports = __webpack_public_path__ + "c31e9820c001c9c4a86bce33ce43b679.png"'
}

assets: ["c31e9820c001c9c4a86bce33ce43b679.png"]

from url-loader.

iam4x avatar iam4x commented on May 30, 2024

Thanks found it 👍

from url-loader.

catamphetamine avatar catamphetamine commented on May 30, 2024

FYI
https://github.com/halt-hammerzeit/webpack-isomorphic-tools

This module enables the thing you tried to implement (requiring images on server for example)

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.