GithubHelp home page GithubHelp logo

Comments (11)

JonasKruckenberg avatar JonasKruckenberg commented on July 23, 2024 1

It was a simple stupid typo in the include patterns lol πŸ˜…
The fixed version should be pushed to rpm in a couple of minutes

from imagetools.

JonasKruckenberg avatar JonasKruckenberg commented on July 23, 2024

Hey thanks for your feedback!
How do you import your image? (In the template,or script part?)
I'm aware of a couple of problems that I'm actively trying to solve at the moment (will be published as version 3 soon hopefully).

Currently importing images involves a lot of fighting vite, sadly.
For example importing images in css does not work at all because the import never gets relayed to plugins.

You can however try to import your image in the script section of your component and use it as a variable.

from imagetools.

yamiteru avatar yamiteru commented on July 23, 2024

This is how I import it:

// @ts-ignore
import image from "./images/01.jpeg?format=webp";
import Work from "../../../src/type/Work";


const work01: Work = {
  slug: "work-01",
  title: "Work 01",
  image,
};


export default work01;

from imagetools.

yamiteru avatar yamiteru commented on July 23, 2024

This is how the output of vite build looks like:

image

And this is how the image looks in network tab:

image

from imagetools.

JonasKruckenberg avatar JonasKruckenberg commented on July 23, 2024

That's strange it really seems like the plugin is not catching the import at all, what does your vite config look like?

from imagetools.

yamiteru avatar yamiteru commented on July 23, 2024
import { defineConfig } from "vite";
import solidPlugin from "vite-plugin-solid";
import imageTools from "vite-imagetools";


export default defineConfig({
  plugins: [
    imageTools(),
    solidPlugin()
  ],
  build: {
    target: "esnext",
    polyfillDynamicImport: false,
  },
});

from imagetools.

JonasKruckenberg avatar JonasKruckenberg commented on July 23, 2024

So I've just created a few test cases with the vitejs create-app vue-ts and preact-ts templates importing images in a couple different way and I cannot reproduce your bug, I can only suspect that it's an issue with the solid plugin.
Can you confirm that this issue still exists when swapping the order of the plugins?
i.e.

plugins: [
    solidPlugin(),
    imageTools()
  ],

instead of

  plugins: [
    imageTools(),
    solidPlugin()
  ],

from imagetools.

yamiteru avatar yamiteru commented on July 23, 2024

It still exists

from imagetools.

JonasKruckenberg avatar JonasKruckenberg commented on July 23, 2024

Ohhhhh... I think I found it, can you try renaming your file from .jpeg to .jpg? I might have forgotten to alias jpeg to jpg πŸ˜…
I'll push a fix for that asap though

from imagetools.

yamiteru avatar yamiteru commented on July 23, 2024

Hell yeah now it's working!

from imagetools.

github-actions avatar github-actions commented on July 23, 2024

πŸŽ‰ This issue has been resolved in version 2.3.3 πŸŽ‰

The release is available on:

Your semantic-release bot πŸ“¦πŸš€

from imagetools.

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.