Skip to content

Commit dbbc5b4

Browse files
committed
feat: update webpack CSS Module behavior to exclude t-bolt classes from getting mangled
1 parent fdca217 commit dbbc5b4

File tree

1 file changed

+19
-10
lines changed

1 file changed

+19
-10
lines changed

packages/build-tools/create-webpack-config.js

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -207,11 +207,15 @@ async function createWebpackConfig(buildConfig) {
207207
isJsFile === true &&
208208
context.resourcePath.includes('.scoped')
209209
) {
210-
return `${localName}--${crypto
211-
.createHash('md5')
212-
.update(localName)
213-
.digest('hex')
214-
.substring(0, 8)}`;
210+
if (localName.includes('t-bolt')){
211+
return localName;
212+
} else {
213+
return `${localName}--${crypto
214+
.createHash('md5')
215+
.update(localName)
216+
.digest('hex')
217+
.substring(0, 8)}`;
218+
}
215219
} else {
216220
return localName;
217221
}
@@ -234,11 +238,16 @@ async function createWebpackConfig(buildConfig) {
234238
generateScopedName(name, filename, css) {
235239
if (filename.includes('.scoped') && isJsFile === false) {
236240
const i = css.indexOf(`.${name}`);
237-
return `${name}--${crypto
238-
.createHash('md5')
239-
.update(name)
240-
.digest('hex')
241-
.substring(0, 8)}`;
241+
242+
if (name.includes('t-bolt')){
243+
return name;
244+
} else {
245+
return `${name}--${crypto
246+
.createHash('md5')
247+
.update(name)
248+
.digest('hex')
249+
.substring(0, 8)}`;
250+
}
242251
} else {
243252
return name;
244253
}

0 commit comments

Comments
 (0)