一覧へ戻る
workshq/rollup-plugin-extensions(新しいタブで開きます)
主要言語: TypeScript
Allows rollup to resolve non .js local files
- star 数
- 5
- watcher 数
- 0
- fork 数
- 2
- issue 数
- 7
- 最終更新
- 2023/08/09
主要言語: TypeScript
Allows rollup to resolve non .js local files
Allow rollup to resolve local files with any extension.
yarn add -D rollup-plugin-extensions
// rollup.config.js import extensions from 'rollup-plugin-extensions'; export default { input: 'main.js', output: { file: 'bundle.js', format: 'cjs', }, plugins: [ extensions({ // Supporting Typescript files // Uses ".mjs, .js" by default extensions: ['.tsx', '.ts', '.jsx', '.js'], // Resolves index dir files based on supplied extensions // This is enable by default resolveIndex: true, }) ] };
Plugins like rollup-plugin-node-resolve can cause issues, if you're building a package, by trying to resolve files in node_modules.
This package strives to have a minimal use case and is primarily focused on adding extension support.
If you need additional features like aliasing, commonjs support, or fully supported nodejs style resolutions try these packages: