Skip to content

Remove all options normalization in js side and everything should work as usual #2835

@hyf0

Description

@hyf0

This is preparation for #1041.

exports: exports ?? 'auto',
hashCharacters: hashCharacters ?? 'base64',
sourcemap: sourcemap ?? false,
sourcemapIgnoreList:
typeof sourcemapIgnoreList === 'function'
? sourcemapIgnoreList
: sourcemapIgnoreList === false
? () => false
: (relativeSourcePath: string, _sourcemapPath: string) =>
relativeSourcePath.includes('node_modules'),
sourcemapPathTransform,
banner: getAddon(opts, 'banner'),
footer: getAddon(opts, 'footer'),
intro: getAddon(opts, 'intro'),
outro: getAddon(opts, 'outro'),
esModule: esModule ?? 'if-default-prop',
// TODO support functions
globals: globals ?? {},
entryFileNames: entryFileNames ?? '[name].js',
chunkFileNames: chunkFileNames ?? '[name]-[hash].js',
cssEntryFileNames: cssEntryFileNames ?? '[name].css',
cssChunkFileNames: cssChunkFileNames ?? '[name]-[hash].css',
assetFileNames: assetFileNames ?? 'assets/[name]-[hash][extname]',

  • All these ?? should be removed.

plugins: RolldownPlugin[]
format: InternalModuleFormat
exports: 'auto' | 'named' | 'default' | 'none'
sourcemap: boolean | 'inline' | 'hidden'
sourcemapIgnoreList: SourcemapIgnoreListOption
banner: AddonFunction
footer: AddonFunction
intro: AddonFunction
outro: AddonFunction
esModule: boolean | 'if-default-prop'
assetFileNames: string
inlineDynamicImports: boolean

  • Inconsistent NormalizedOutputOptions compared to rollup is acceptable for now.

See #2834 for example.

Metadata

Metadata

Assignees

Type

No type

Priority

None yet

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions