@mui/internal-babel-plugin-minify-errors 2.0.8-canary.21 → 2.0.8-canary.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +5 -4
- package/index.test.js +2 -0
- package/package.json +6 -4
package/index.js
CHANGED
|
@@ -366,12 +366,13 @@ module.exports = function plugin(
|
|
|
366
366
|
|
|
367
367
|
if (!extracted) {
|
|
368
368
|
if (collectErrors) {
|
|
369
|
+
const baseError =
|
|
370
|
+
'Unminifyable error. You can only use literal strings and template strings as error messages.';
|
|
369
371
|
// Mutates the caller's Set
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
'Unminifyable error. You can only use literal strings and template strings as error messages.',
|
|
373
|
-
),
|
|
372
|
+
const error = messagePath.buildCodeFrameError(
|
|
373
|
+
state.filename ? `Error in ${state.filename} -\n${baseError}` : baseError,
|
|
374
374
|
);
|
|
375
|
+
collectErrors.add(error);
|
|
375
376
|
} else {
|
|
376
377
|
newExpressionPath.addComment(
|
|
377
378
|
'leading',
|
package/index.test.js
CHANGED
|
@@ -174,10 +174,12 @@ describe('collectErrors', () => {
|
|
|
174
174
|
expect(/** @type {Error} */ (collected[0]).message).toMatch(
|
|
175
175
|
/Unminifyable error. You can only use literal strings and template strings as error messages./,
|
|
176
176
|
);
|
|
177
|
+
expect(/** @type {Error} */ (collected[0]).message).toMatch(/Error in \/test\/file.js/);
|
|
177
178
|
expect(collected[1]).toBeInstanceOf(Error);
|
|
178
179
|
expect(/** @type {Error} */ (collected[1]).message).toMatch(
|
|
179
180
|
/Unminifyable error. You can only use literal strings and template strings as error messages./,
|
|
180
181
|
);
|
|
182
|
+
expect(/** @type {Error} */ (collected[0]).message).toMatch(/Error in \/test\/file.js/);
|
|
181
183
|
});
|
|
182
184
|
|
|
183
185
|
it('continues collection past unminifyable errors', () => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mui/internal-babel-plugin-minify-errors",
|
|
3
|
-
"version": "2.0.8-canary.
|
|
3
|
+
"version": "2.0.8-canary.23",
|
|
4
4
|
"author": "MUI Team",
|
|
5
5
|
"description": "This is an internal package not meant for general use.",
|
|
6
6
|
"repository": {
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"find-package-json": "^1.2.0"
|
|
22
22
|
},
|
|
23
23
|
"devDependencies": {
|
|
24
|
-
"@babel/core": "7.
|
|
24
|
+
"@babel/core": "7.29.0",
|
|
25
25
|
"@types/babel__core": "7.20.5",
|
|
26
26
|
"@types/babel__helper-module-imports": "7.18.3",
|
|
27
27
|
"@types/find-package-json": "1.2.7",
|
|
@@ -43,6 +43,8 @@
|
|
|
43
43
|
"publishConfig": {
|
|
44
44
|
"access": "public"
|
|
45
45
|
},
|
|
46
|
-
"gitSha": "
|
|
47
|
-
"scripts": {
|
|
46
|
+
"gitSha": "716b18b5736b5dbc740d49e481c99cb85b74e42e",
|
|
47
|
+
"scripts": {
|
|
48
|
+
"test": "pnpm -w test --project @mui/internal-babel-plugin-minify-errors"
|
|
49
|
+
}
|
|
48
50
|
}
|