@mui/internal-babel-plugin-minify-errors 2.0.8-canary.22 → 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 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
- collectErrors.add(
371
- messagePath.buildCodeFrameError(
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.22",
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": {
@@ -43,6 +43,8 @@
43
43
  "publishConfig": {
44
44
  "access": "public"
45
45
  },
46
- "gitSha": "74232307111caed6f4d181e941df5c358f57ed28",
47
- "scripts": {}
46
+ "gitSha": "716b18b5736b5dbc740d49e481c99cb85b74e42e",
47
+ "scripts": {
48
+ "test": "pnpm -w test --project @mui/internal-babel-plugin-minify-errors"
49
+ }
48
50
  }