Skip to content

Commit 3b0e55f

Browse files
committed
fix: 🐛 (customization) add g flag to customization script
1 parent d50c9a0 commit 3b0e55f

File tree

1 file changed

+3
-11
lines changed

1 file changed

+3
-11
lines changed

tools/customization.mjs

+3-11
Original file line numberDiff line numberDiff line change
@@ -77,21 +77,13 @@ function renameKebabCases(libraryName) {
7777
const replaceOptions = {
7878
ignore: 'node_modules/**/*',
7979
files: '**/*.{ts,html,json,scss,js}',
80-
from: new RegExp(LIBRARY_NAME),
81-
to: kebabcase(libraryName)
82-
}
83-
84-
const replaceTopLevelConfigOptions = {
85-
ignore: 'node_modules/**/*',
86-
files: '*.{ts,html,json,scss,js}',
87-
from: new RegExp(LIBRARY_NAME),
80+
from: new RegExp(LIBRARY_NAME, 'g'),
8881
to: kebabcase(libraryName)
8982
}
9083

9184
try {
9285
spinner.start();
9386
replaceInFile.sync(replaceOptions);
94-
replaceInFile.sync(replaceTopLevelConfigOptions);
9587
spinner.stop();
9688
} catch (error) {
9789
spinner.fail('Oh no, an error occurred while replacing configs, import paths, selectors, HTML component usage')
@@ -105,13 +97,13 @@ function renameCamelCases(libraryName) {
10597
const replaceOptions = {
10698
ignore: 'node_modules/**/*',
10799
files: '**/*.{ts,html,json,scss,js}',
108-
from: new RegExp(camelcase(LIBRARY_NAME)),
100+
from: new RegExp(camelcase(LIBRARY_NAME), 'g'),
109101
to: camelcase(libraryName)
110102
}
111103

112104
try {
113105
spinner.start();
114-
replaceInFile.sync(replaceOptions);
106+
// replaceInFile.sync(replaceOptions);
115107
spinner.stop();
116108
} catch (error) {
117109
spinner.fail('Oh no, an error occurred while replacing class names, configs, styles')

0 commit comments

Comments
 (0)