Skip to content

Commit 3839d95

Browse files
committed
fix: preProcessJs #41
1 parent 2a410d6 commit 3839d95

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

packages/core/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@tailwindcss-mangle/core",
3-
"version": "2.0.5",
3+
"version": "2.0.6",
44
"description": "The core of tailwindcss-mangle",
55
"exports": {
66
".": {

packages/core/src/js/pre.ts

+5-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,11 @@ export function handleValue(options: { raw: string; node: babel.types.StringLite
2626
}
2727
}
2828
if (typeof node.start === 'number' && typeof node.end === 'number' && value) {
29-
magicString.update(node.start + offset, node.end - offset, escape ? jsStringEscape(value) : value)
29+
const start = node.start + offset
30+
const end = node.end - offset
31+
if (start < end) {
32+
magicString.update(start, end, escape ? jsStringEscape(value) : value)
33+
}
3034
}
3135
}
3236

packages/unplugin-tailwindcss-mangle/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "unplugin-tailwindcss-mangle",
3-
"version": "2.0.4",
3+
"version": "2.0.6",
44
"description": "mangle tailwindcss utilities class plugin. support vite and webpack!",
55
"main": "./dist/index.cjs",
66
"module": "./dist/index.mjs",

0 commit comments

Comments
 (0)