Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG]: outputPath doesn't seem to affect anything #6

Open
fiskhandlarn opened this issue Jul 2, 2021 · 5 comments
Open

[BUG]: outputPath doesn't seem to affect anything #6

fiskhandlarn opened this issue Jul 2, 2021 · 5 comments
Assignees
Labels
documentation Improvements or additions to documentation pinned Prevent stale on pinned items

Comments

@fiskhandlarn
Copy link
Contributor

Prerequisites

Description

When I set outputPath and/or publicPath as described in README.md nothing seems to happen. The generated files are still written to the default public path. The only reference in the code that I can find is

publicPath?: string,
which only looks like a definition, but does the package do anything? Any help is appreciated.

Steps to Reproduce

  1. Install this package and vite
  2. Configure like so:
    ViteFaviconsPlugin({
      logo: 'resources/static/images/favicons/goteborgsregionen.svg',
      publicPath: `public/themes/${process.env.WP_THEME}/assets/images/favicons`,
    }
  1. Run npm run build

Expected behavior:

I expect the files to be placed in assets/images/favicons/.

Actual behavior:

The files end up in assets/.

Reproduces how often:

100%

Versions

Platform: Docker
Version: 1.0.8
Editor(v): Emacs ¯_(ツ)_/¯
OS: Windows 10
@fiskhandlarn fiskhandlarn added the bug Something isn't working label Jul 2, 2021
@fiskhandlarn
Copy link
Contributor Author

Oh, I just noticed this:

Public Path is delegated to Rollup/Vite (keeping for people migrating from Webpack)

That explains. But, can someone please help me explain how I can move files? https://www.npmjs.com/package/rollup-plugin-cpy doesn't seem to support moving files.

@josh-hemphill
Copy link
Owner

Yes, Vite doesn't give a lot of options for handling where files are output. Why do you need to move instead of copy your dist files? If you just need to clean up your dist folder after generating you could just tack an rm -R dist after your npm script, or for cross-platform and glob deletion install rimraf. e.g.

{
  "scripts":{
    "build":"vite build && rimraf 'dist/**.(png|ico)'"
  }
}

FYI, This package is currently broken. I've run into limitations of the Favicons package (it wasn't built with library authors in mind).
My project at work that was going to use this got canceled, so I haven't had the time to finish rolling my own image generator library.

@josh-hemphill josh-hemphill added documentation Improvements or additions to documentation and removed bug Something isn't working labels Jul 2, 2021
@josh-hemphill
Copy link
Owner

I'm going to keep this issue open as a documentation improvement. Once the package is working I'll want to potentially hide any no-op options and only specify the webpack config compatibility.

@stale

This comment has been minimized.

@stale stale bot added the stale label Aug 31, 2021
@stale stale bot closed this as completed Sep 7, 2021
@josh-hemphill josh-hemphill added pinned Prevent stale on pinned items and removed stale labels Sep 16, 2021
@josh-hemphill josh-hemphill reopened this Sep 16, 2021
@roeeash
Copy link

roeeash commented Apr 19, 2023

I encountered the same issue, is there a solution for it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation pinned Prevent stale on pinned items
Projects
None yet
Development

No branches or pull requests

3 participants