@deephaven/babel-preset 0.15.6-vite.21 → 0.16.0

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
@@ -1,5 +1,3 @@
1
- const path = require('path');
2
-
3
1
  module.exports = api => ({
4
2
  presets: [
5
3
  [
@@ -20,15 +18,7 @@ module.exports = api => ({
20
18
  ['@babel/preset-typescript', { allowDeclareFields: true }],
21
19
  ],
22
20
  plugins: [
23
- api.env('test')
24
- ? [
25
- // This is needed to replace import.meta w/ process in Jest
26
- // Jest does not play nicely w/ ESM and Vite uses import.meta
27
- // import.meta is only avaialable in ESM
28
- path.resolve(__dirname, 'importMetaEnvPlugin'),
29
- ]
30
- : // The add-import-extension plugin causes Jest to error, but is needed for proper ESM builds
31
- ['babel-plugin-add-import-extension'],
21
+ api.env('test') ? false : ['babel-plugin-add-import-extension'],
32
22
  [
33
23
  'transform-rename-import',
34
24
  {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@deephaven/babel-preset",
3
- "version": "0.15.6-vite.21+822fd63",
3
+ "version": "0.16.0",
4
4
  "description": "Deephaven Babel preset",
5
5
  "repository": {
6
6
  "type": "git",
@@ -22,5 +22,5 @@
22
22
  "publishConfig": {
23
23
  "access": "public"
24
24
  },
25
- "gitHead": "822fd633ddb5c62b896547cf90b1cad01799a346"
25
+ "gitHead": "1d10956499cd451145e704690bc8f2d5cfb6a786"
26
26
  }
@@ -1,24 +0,0 @@
1
- /**
2
- * A very simple babel transform that replaces import.meta.env with process.env
3
- * Jest does not handle ESM well, but Vite uses import.meta.env for many variables
4
- * As a result, Jest complains about these instances
5
- * Inspired by https://github.com/javiertury/babel-plugin-transform-import-meta/blob/master/src/index.ts
6
- */
7
-
8
- module.exports = () => ({
9
- name: 'transform-import-meta-env',
10
- visitor: {
11
- MemberExpression(path) {
12
- const { node } = path;
13
- if (
14
- node.object.type === 'MetaProperty' &&
15
- node.object.meta.name === 'import' &&
16
- node.object.property.name === 'meta' &&
17
- node.property.type === 'Identifier' &&
18
- node.property.name === 'env'
19
- ) {
20
- path.replaceWithSourceString('process.env');
21
- }
22
- },
23
- },
24
- });