mirror of
https://github.com/angular/angular-cli.git
synced 2025-05-25 08:41:39 +08:00
refactor: rename internal vite plugin name.
Follow convention.
This commit is contained in:
parent
b168948687
commit
f5c250ab48
@ -17,8 +17,9 @@ const escapeRegexSpecialChars = (inputString: string): string => {
|
||||
return inputString.replace(/[.*+?^${}()|[\]\\]/g, '\\$&'); // $& means the whole matched string
|
||||
};
|
||||
|
||||
export const createRemoveIdPrefixPlugin = (externals: string[]): Plugin => ({
|
||||
name: 'vite-plugin-remove-id-prefix',
|
||||
export function createRemoveIdPrefixPlugin(externals: string[]): Plugin {
|
||||
return {
|
||||
name: 'angular-plugin-remove-id-prefix',
|
||||
apply: 'serve',
|
||||
configResolved: (resolvedConfig) => {
|
||||
// don't do anything when the list of externals is empty
|
||||
@ -38,7 +39,7 @@ export const createRemoveIdPrefixPlugin = (externals: string[]): Plugin => ({
|
||||
// we must add our actual plugin dynamically, to ensure that it will run
|
||||
// AFTER the import-analysis.
|
||||
resolvedConfig.plugins.push({
|
||||
name: 'vite-plugin-remove-id-prefix-transform',
|
||||
name: 'angular-plugin-remove-id-prefix-transform',
|
||||
transform: (code: string) => {
|
||||
// don't do anything when code does not contain the Vite prefix
|
||||
if (!code.includes(VITE_ID_PREFIX)) {
|
||||
@ -49,4 +50,5 @@ export const createRemoveIdPrefixPlugin = (externals: string[]): Plugin => ({
|
||||
},
|
||||
});
|
||||
},
|
||||
});
|
||||
};
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user