babel-plugin-reactylon 1.0.7 → 1.1.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/README.md CHANGED
@@ -83,7 +83,7 @@ export default defineConfig({
83
83
  ```
84
84
 
85
85
  ### Additional configurations
86
- Additionally you can manually define extra side effects (see [Babylon.js ES6 support FAQ](https://doc.babylonjs.com/setup/frameworkPackages/es6Support/#faq)) or specify a custom `node_modules` path (useful if you are working with a monorepo setup).
86
+ Additionally you can manually define extra side effects (see [Babylon.js ES6 support FAQ](https://doc.babylonjs.com/setup/frameworkPackages/es6Support/#faq)).
87
87
 
88
88
  ```js
89
89
  ['babel-plugin-reactylon', {
@@ -91,8 +91,6 @@ Additionally you can manually define extra side effects (see [Babylon.js ES6 sup
91
91
  sideEffects: [
92
92
  '@babylonjs/core/Engines/Extensions/engine.query.js'
93
93
  ]
94
- // node modules path (optional)
95
- nodeModulesPath: '../../node_modules'
96
94
  }]
97
95
  ```
98
96
 
package/build/index.js CHANGED
@@ -166,8 +166,10 @@ export default declare((api) => {
166
166
  if (t.isMemberExpression(callee)) {
167
167
  const property = callee.property;
168
168
  if (t.isIdentifier(property)) {
169
- if (property.name in coreSideEffectsMap) {
170
- sideEffects.push(t.importDeclaration([], t.stringLiteral(coreSideEffectsMap[property.name])));
169
+ const sideEffectPath = coreSideEffectsMap[property.name];
170
+ // exclude assets folder where there are .wasm and relative .js files
171
+ if (sideEffectPath && !sideEffectPath.startsWith('@babylonjs/core/assets/')) {
172
+ sideEffects.push(t.importDeclaration([], t.stringLiteral(sideEffectPath)));
171
173
  // callPath.stop();
172
174
  }
173
175
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "babel-plugin-reactylon",
3
- "version": "1.0.7",
3
+ "version": "1.1.0",
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",