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

Custom output rollup configuration is overhidden by the default configuration #1410

Open
edieval opened this issue May 10, 2021 · 8 comments
Milestone

Comments

@edieval
Copy link

edieval commented May 10, 2021

Describe the bug
In the svelte configuration file when we try to set the assetFileNames or chunkFileNames in output rollup, this is overhidden by the default configuration

To Reproduce
Set a assetFileNames in the rollup options and check the assets files.

Expected behavior
The configuration set in the svelte configuration file must be used.

Information about your SvelteKit Installation:
Next version: 103

Severity
Blocking our usage of SvelteKit: declare static asset files in the micro-frontend application

Additional context
This portion of code seems to be the origin of the issue:

...(user_config.build && user_config.build.rollupOptions),

	rollupOptions: {
		...(user_config.build && user_config.build.rollupOptions),
		input,
		output: {
			entryFileNames: '[name]-[hash].js',
			chunkFileNames: 'chunks/[name]-[hash].js',
			assetFileNames: 'assets/[name]-[hash][extname]'
		},
		preserveEntrySignatures: 'strict'
	}
},
@Rich-Harris
Copy link
Member

Can you elaborate on why you need to customise these filenames?

@edieval
Copy link
Author

edieval commented May 11, 2021

We need to register the assets in our micro-frontend application and it's easier with static file names. So, we tried to remove the hash and simplify paths.

But, well, It's more about the point that we can configure them in the svelte config file but the config is not applied than our usage.
We can add a tool to change the file names after build.

@Rich-Harris
Copy link
Member

It sounds like what you really need is access to the manifest Vite generates linking source files to their built counterparts?

@ThomasRumasLM
Copy link

Hello guys, it doesn't seem to be fixed with this issue #1572. I've just installed the last @next.132 version and I've this message during the build :

build_client: The value for kit.vite.build.rollupOptions.output.entryFileNames specified in svelte.config.js has been ignored. This option is controlled by SvelteKit.
 
build_client: The value for kit.vite.build.rollupOptions.output.chunkFileNames specified in svelte.config.js has been ignored. This option is controlled by SvelteKit.

build_client: The value for kit.vite.build.rollupOptions.output.assetFileNames specified in svelte.config.js has been ignored. This option is controlled by SvelteKit.

@mrrfv

This comment was marked as duplicate.

@Rich-Harris Rich-Harris added this to the post-1.0 milestone Apr 23, 2022
@DougAnderson444
Copy link

I was going to remove the hash in the filename to work around #4528 by building index.html once, but this is in my way too.

If I can have static filenames in index.html (which fails to be generated b/c #4528) then I can work around the adapter bug.

@raduab
Copy link
Contributor

raduab commented Sep 28, 2022

I was able to achieve this by writing a Vite plugin, however it didn't work for assets. See this discussion.

@OwsOwies
Copy link

It would also be great if we could obfuscate filenames.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants