-
Notifications
You must be signed in to change notification settings - Fork 634
Closed
Labels
Description
Reproduction link or steps
output.assetFileNames
configuration option is ignored by Rolldown. Also note that unlike Rollup, it doesn't allow passing function, only a string.
import { defineConfig } from "rolldown";
import css from "rollup-plugin-import-css";
export default defineConfig({
input: ['./src/entry.js', './src/other-entry.js'],
output: {
assetFileNames: "my.css",
// assetFileNames: () => "my.css",
},
plugins: [css()],
});
Repro: https://stackblitz.com/~/edit/github-8tvmh5ew
Commands:
- Rolldown build:
npm run build
- Rollup build:
npm run buildup
What is expected?
- I expect Rolldown to respect
assetFileNames: "my.css"
option and rename asset fromentry.css
tomy.css
. - I expect Rolldown to allow functions as values for
assetFileNames
.
What is actually happening?
For assetFileNames: "my.css"
Rolldown just renders entry.css
.
For assetFileNames: () => "my.css"
Rolldown raises an error:
rolldown --config ./rolldown.config.js
Error: Failed to convert JavaScript value `function assetFileNames(..) ` into rust type `String` on BindingOutputOptions.assetFileNames on BindingBundlerOptions.outputOptions
at createBundler (.../node_modules/rolldown/dist/shared/src-Bb3zZkPW.mjs:2673:13)
at async #getBundlerWithStopWorker (.../node_modules/rolldown/dist/shared/src-Bb3zZkPW.mjs:2696:26)
at async RolldownBuild.write (.../node_modules/rolldown/dist/shared/src-Bb3zZkPW.mjs:2704:23)
at async bundleInner (.../node_modules/rolldown/dist/esm/cli.mjs:445:17)
at async bundleWithConfig (.../node_modules/rolldown/dist/esm/cli.mjs:365:6)
at async main (.../node_modules/rolldown/dist/esm/cli.mjs:2004:3) {
code: 'StringExpected'
}
System Info
Binaries:
Node: 20.12.1 - ~/.asdf/installs/nodejs/20.12.1/bin/node
Yarn: 1.22.22 - ~/.asdf/installs/nodejs/20.12.1/bin/yarn
npm: 10.5.0 - ~/.asdf/plugins/nodejs/shims/npm
pnpm: 9.12.1 - ~/.asdf/installs/nodejs/20.12.1/bin/pnpm
bun: 1.1.21 - ~/.bun/bin/bun
npmPackages:
rolldown: ^1.0.0-beta.1 => 1.0.0-beta.1
Any additional comments?
No response