-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add support for excludeAssets and excludeModules options
- Loading branch information
Showing
7 changed files
with
415 additions
and
192 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
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
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 +1,3 @@ | ||
export type ExcludeFilepathConfig = string | RegExp | ((filepath: string) => boolean); | ||
export type ExcludeFilepathParam = string | RegExp | ((filepath: string) => boolean); | ||
|
||
export type ExcludeFilepathOption = ExcludeFilepathParam | Array<ExcludeFilepathParam>; |
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,176 @@ | ||
import path from 'path'; | ||
import type { OutputBundle } from 'rollup'; | ||
|
||
const ROOT_DIR = path.join(__dirname, '../../../'); | ||
|
||
export default { | ||
'assets/logo-abcd1234.svg': { | ||
name: undefined, | ||
fileName: 'assets/logo-abcd1234.svg', | ||
type: 'asset', | ||
source: '<svg></svg>', | ||
needsCodeReference: true, | ||
}, | ||
'assets/main-abcd1234.js': { | ||
name: 'main', | ||
fileName: 'assets/main-abcd1234.js', | ||
preliminaryFileName: 'assets/main-abcd1234.js', | ||
sourcemapFileName: 'assets/main-abcd1234.js.map', | ||
type: 'chunk', | ||
code: 'export default function () {}', | ||
isEntry: true, | ||
isDynamicEntry: false, | ||
facadeModuleId: null, | ||
map: null, | ||
isImplicitEntry: false, | ||
implicitlyLoadedBefore: [], | ||
importedBindings: {}, | ||
referencedFiles: [], | ||
moduleIds: [ | ||
path.join(ROOT_DIR, 'src/component-a.js'), | ||
path.join(ROOT_DIR, 'src/index.js'), | ||
], | ||
modules: { | ||
[path.join(ROOT_DIR, 'src/component-a.js')]: { | ||
code: 'export default A = 1;', | ||
originalLength: 10, | ||
renderedLength: 8, | ||
removedExports: [], | ||
renderedExports: [], | ||
}, | ||
[path.join(ROOT_DIR, 'src/index.js')]: { | ||
code: '', | ||
originalLength: 100, | ||
renderedLength: 80, | ||
removedExports: [], | ||
renderedExports: [], | ||
}, | ||
}, | ||
imports: [], | ||
exports: [], | ||
dynamicImports: [], | ||
}, | ||
'assets/vendors-abcd1234.js': { | ||
name: 'vendors', | ||
fileName: 'assets/vendors-abcd1234.js', | ||
preliminaryFileName: 'assets/vendors-abcd1234.js', | ||
sourcemapFileName: 'assets/vendors-abcd1234.js.map', | ||
type: 'chunk', | ||
code: 'export default function () {}', | ||
isEntry: true, | ||
isDynamicEntry: false, | ||
facadeModuleId: null, | ||
map: null, | ||
isImplicitEntry: false, | ||
implicitlyLoadedBefore: [], | ||
importedBindings: {}, | ||
referencedFiles: [], | ||
moduleIds: [ | ||
path.join(ROOT_DIR, 'node_modules', 'package-a', 'index.js'), | ||
path.join(ROOT_DIR, 'node_modules', 'package-b', 'index.js'), | ||
], | ||
modules: { | ||
[path.join( | ||
ROOT_DIR, | ||
'node_modules', | ||
'package-a', | ||
'index.js' | ||
)]: { | ||
code: '', | ||
originalLength: 10, | ||
renderedLength: 8, | ||
removedExports: [], | ||
renderedExports: [], | ||
}, | ||
[path.join( | ||
ROOT_DIR, | ||
'node_modules', | ||
'package-b', | ||
'index.js' | ||
)]: { | ||
code: '', | ||
originalLength: 100, | ||
renderedLength: 80, | ||
removedExports: [], | ||
renderedExports: [], | ||
}, | ||
}, | ||
imports: [], | ||
exports: [], | ||
dynamicImports: [], | ||
}, | ||
'assets/index-abcd1234.js': { | ||
name: 'index', | ||
fileName: 'assets/index-abcd1234.js', | ||
preliminaryFileName: 'assets/index-abcd1234.js', | ||
sourcemapFileName: 'assets/index-abcd1234.js.map', | ||
type: 'chunk', | ||
code: 'export default function () {}', | ||
isEntry: false, | ||
isDynamicEntry: true, | ||
facadeModuleId: null, | ||
map: null, | ||
isImplicitEntry: false, | ||
implicitlyLoadedBefore: [], | ||
importedBindings: {}, | ||
referencedFiles: [], | ||
moduleIds: [ | ||
path.join(ROOT_DIR, 'src', 'components/component-b/index.js'), | ||
], | ||
modules: { | ||
[path.join( | ||
ROOT_DIR, | ||
'src', | ||
'components', | ||
'component-b', | ||
'index.js', | ||
)]: { | ||
code: '', | ||
originalLength: 10, | ||
renderedLength: 8, | ||
removedExports: [], | ||
renderedExports: [], | ||
}, | ||
}, | ||
imports: [], | ||
exports: [], | ||
dynamicImports: [], | ||
}, | ||
'assets/index-efab5678.js': { | ||
name: 'index', | ||
fileName: 'assets/index-efab5678.js', | ||
preliminaryFileName: 'assets/index-efab5678.js', | ||
sourcemapFileName: 'assets/index-efab5678.js.map', | ||
type: 'chunk', | ||
code: 'export default function () {}', | ||
isEntry: false, | ||
isDynamicEntry: true, | ||
facadeModuleId: null, | ||
map: null, | ||
isImplicitEntry: false, | ||
implicitlyLoadedBefore: [], | ||
importedBindings: {}, | ||
referencedFiles: [], | ||
moduleIds: [ | ||
path.join(ROOT_DIR, 'src', 'components/component-c/index.js'), | ||
], | ||
modules: { | ||
[path.join( | ||
ROOT_DIR, | ||
'src', | ||
'components', | ||
'component-c', | ||
'index.js', | ||
)]: { | ||
code: '', | ||
originalLength: 10, | ||
renderedLength: 8, | ||
removedExports: [], | ||
renderedExports: [], | ||
}, | ||
}, | ||
imports: [], | ||
exports: [], | ||
dynamicImports: [], | ||
}, | ||
} satisfies OutputBundle; |
Oops, something went wrong.