antfu-collective / vite-ssg

Static site generation for Vue 3 on Vite
MIT License
1.27k stars 129 forks source link

Bundled code leaks absolute file paths #354

Closed foxxyz closed 1 year ago

foxxyz commented 1 year ago

Describe the bug

Bundled code contains absolute paths, leaking user's directory structure in output.

Previously reported in #349

This likely also makes builds non-deterministic between different machines.

> git clone git@github.com:antfu/vitesse.git
> cd vitesse
> npm install
> npm run build
> cat dist/assets/app-*.js | grep -o '.*index.vue'
...
...const jb=Nr(Af,[["__file","/your/local/computer/path/to/vitesse/src/pages/index.vue

Reproduction

https://github.com/antfu/vitesse

System Info

System:
    OS: macOS 13.4
    CPU: (10) arm64 Apple M1 Max
    Memory: 18.53 GB / 64.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 20.2.0 - /opt/homebrew/bin/node
    npm: 9.6.6 - /opt/homebrew/bin/npm
  Browsers:
    Chrome: 114.0.5735.133
    Safari: 16.5

Used Package Manager

npm

Validations

foxxyz commented 1 year ago

Fixed with 675657a on merge of #356