-
-
Notifications
You must be signed in to change notification settings - Fork 6.2k
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
CSS file name changed after v3 upgrade #9877
Comments
this works for me, with vite v3.1.0 // vite.config.js
import { defineConfig } from "vite";
import solidPlugin from "vite-plugin-solid"; // solidjs framework
const assetsDir = 'assets/';
const outputDefaults = {
// remove hashes from filenames
entryFileNames: `${assetsDir}[name].js`,
chunkFileNames: `${assetsDir}[name].js`,
assetFileNames: `${assetsDir}[name].[ext]`,
}
export default defineConfig({
plugins: [
solidPlugin(), // solidjs framework
],
build: {
target: "esnext",
polyfillDynamicImport: false,
//sourcemap: true,
rollupOptions: {
output: {
...outputDefaults,
}
},
},
worker: {
rollupOptions: {
output: {
...outputDefaults,
}
},
},
}); example output
when i remove
but all the other filenames are ok duplicate of #7613 |
I run into the same issue, and it ignores not only the file name, but also the specified path: build: {
rollupOptions: {
input: {
'js/main.js': 'resources/js/app.js',
'js/utils/my-util.js': 'resources/js/utils/my-util.js',
'css/main.css': 'resources/sass/app.css',
'css/utils/colors.css': 'resources/sass/utils/my-util.css',
}
}
}, produces
I would also like to highlight that this bug does not affect JavaScript file. |
Still have this problem; any update? Built css files end up named "index-[hash].css" instead of using the [name]. |
Still occurring in v4.0.4, FYI. |
It seems that PR #9485 fixes this bug. |
This issue also occurs when using the |
Describe the bug
Hello! I have a pretty basic vite.config.ts. Main area of interest is this:
With Vite 2.x, it would produce this output:
After upgrading to Vite 3 it changed to this:
Is that change intentional? Is there an easy way to get this behavior back, beyond adding a hack in assetFileNames?
Thanks!
Reproduction
https://stackblitz.com/edit/vitejs-vite-r2ykgd?file=vite.config.js
System Info
Used Package Manager
npm
Logs
No response
Validations
The text was updated successfully, but these errors were encountered: