-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Migrate from rollup to rolldown (#3578)
* Migrate from rollup to rolldown * use defineConfig * tweak command * update rolldown * update rolldown * update rolldown config * don't need this * add todo, remove other comment * remove most babel deps * update rolldown * use output array * pin @vitest/eslint-plugin
- Loading branch information
Showing
5 changed files
with
47 additions
and
79 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,3 @@ | ||
{ | ||
"presets": [ | ||
[ | ||
"@babel/env", | ||
{ | ||
"loose": true, | ||
"bugfixes": true, | ||
"shippedProposals": true | ||
} | ||
], | ||
["@babel/react", { "runtime": "automatic" }], | ||
"@babel/typescript" | ||
], | ||
"plugins": [ | ||
"@babel/transform-runtime", | ||
["optimize-clsx", { "functionNames": ["getCellClassname"] }] | ||
] | ||
"presets": ["@babel/typescript"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
// @ts-check | ||
import { isAbsolute } from 'node:path'; | ||
import wyw from '@wyw-in-js/rollup'; | ||
import pkg from './package.json' with { type: 'json' }; | ||
import { defineConfig } from 'rolldown'; | ||
|
||
export default defineConfig({ | ||
input: './src/index.ts', | ||
output: [ | ||
{ | ||
dir: 'lib', | ||
entryFileNames: 'bundle.js', | ||
cssEntryFileNames: 'styles.css', | ||
format: 'es', | ||
sourcemap: true | ||
}, | ||
{ | ||
dir: 'lib', | ||
entryFileNames: 'bundle.cjs', | ||
cssEntryFileNames: 'styles.css', | ||
format: 'cjs', | ||
sourcemap: true | ||
} | ||
], | ||
platform: 'browser', | ||
external: (id) => !id.startsWith('.') && !isAbsolute(id), | ||
plugins: [ | ||
// @ts-expect-error | ||
wyw({ | ||
preprocessor: 'none', | ||
/** | ||
* @param {string} hash | ||
*/ | ||
classNameSlug(hash) { | ||
// We add the package version as suffix to avoid style conflicts | ||
// between multiple versions of RDG on the same page. | ||
return `${hash}${pkg.version.replaceAll('.', '-')}`; | ||
} | ||
}) | ||
] | ||
}); |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters