babel-plugin-reactylon 1.0.5 → 1.0.6

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.
Files changed (2) hide show
  1. package/build/index.js +15 -1
  2. package/package.json +2 -2
package/build/index.js CHANGED
@@ -101,12 +101,26 @@ export default declare((api) => {
101
101
  // Add implicit side effects (derived from static parse of JSX Reactylon code)
102
102
  const isMultipleCanvas = type === 'Engine' && attributes.some(attr => t.isJSXAttribute(attr) && attr.name.name === "isMultipleCanvas");
103
103
  if (isMultipleCanvas) {
104
- sideEffects.push(t.importDeclaration([], t.stringLiteral('@babylonjs/core/Engines/AbstractEngine/abstractEngine.views')));
104
+ sideEffects.push(t.importDeclaration([], t.stringLiteral('@babylonjs/core/Engines/AbstractEngine/abstractEngine.views.js')));
105
105
  }
106
106
  const isPhysicsEngine = type === 'Scene' && attributes.some(attr => t.isJSXAttribute(attr) && attr.name.name === "physicsOptions");
107
107
  if (isPhysicsEngine) {
108
108
  sideEffects.push(t.importDeclaration([], t.stringLiteral('@babylonjs/core/Physics/physicsEngineComponent.js')));
109
109
  }
110
+ const isAudio = type === 'sound';
111
+ if (isAudio) {
112
+ // Audio v1
113
+ sideEffects.push(t.importDeclaration([], t.stringLiteral('@babylonjs/core/Audio/audioSceneComponent.js')));
114
+ // sideEffects.push(t.importDeclaration([], t.stringLiteral('@babylonjs/core/Audio/audioEngine.js')));
115
+ }
116
+ const isCheckCollisions = attributes.some(attr => t.isJSXAttribute(attr) && attr.name.name === "checkCollisions");
117
+ if (isCheckCollisions) {
118
+ sideEffects.push(t.importDeclaration([], t.stringLiteral('@babylonjs/core/Collisions/collisionCoordinator.js')));
119
+ }
120
+ const isHighlightLayer = type === 'highlightLayer';
121
+ if (isHighlightLayer) {
122
+ sideEffects.push(t.importDeclaration([], t.stringLiteral('@babylonjs/core/Layers/effectLayerSceneComponent.js')));
123
+ }
110
124
  const isBoundingBox = attributes.some(attr => t.isJSXAttribute(attr) && attr.name.name === "showBoundingBox");
111
125
  if (isBoundingBox) {
112
126
  sideEffects.push(t.importDeclaration([], t.stringLiteral('@babylonjs/core/Rendering/boundingBoxRenderer.js')));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "babel-plugin-reactylon",
3
- "version": "1.0.5",
3
+ "version": "1.0.6",
4
4
  "description": "Babel plugin to enable tree-shaking of Babylon.js classes within a Reactylon application.",
5
5
  "main": "build/index.js",
6
6
  "type": "module",
@@ -27,7 +27,7 @@
27
27
  "@babel/core": "^7.26.10",
28
28
  "@babylonjs/core": "^7.0.0 || ^8.0.0",
29
29
  "@babylonjs/gui": "^7.0.0 || ^8.0.0",
30
- "reactylon": "*"
30
+ "reactylon": "^3.0.0"
31
31
  },
32
32
  "keywords": [
33
33
  "babel",