Skip to content

Commit

Permalink
Merge pull request #443 from c-frame/esmodule
Browse files Browse the repository at this point in the history
Allow to import specific modules
  • Loading branch information
vincentfretin authored Mar 13, 2024
2 parents f4a2bb5 + 4d4e364 commit 0c96ee8
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 4 deletions.
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,13 @@ npm install --save aframe-extras

```javascript
// index.js
require('aframe-extras');
import 'aframe-extras';
// or specific packages
import "aframe-extras/controls/index.js";
import "aframe-extras/pathfinding/index.js";
```

Once installed, you'll need to compile your JavaScript using something like [webpack](https://webpack.js.org).
Once installed, you'll need to compile your JavaScript using something like [webpack](https://webpack.js.org) with three defined as external, see webpack.config.js in this repo for an example.

## Examples

Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 9 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,14 @@
"author": "Don McCurdy <dm@donmccurdy.com>",
"license": "MIT",
"main": "index.js",
"exports": {
".": "index.js",
"./controls/*": "./src/controls/*",
"./loaders/*": "./src/loaders/*",
"./misc/*": "./src/misc/*",
"./pathfinding/*": "./src/pathfinding/*",
"./primitives/*": "./src/primitives/*"
},
"repository": {
"type": "git",
"url": "git+https://github.com/c-frame/aframe-extras.git"
Expand All @@ -17,7 +25,7 @@
},
"dependencies": {
"nipplejs": "^0.10.1",
"three": "0.159.0",
"three": "^0.159.0",
"three-pathfinding": "^1.1.0"
},
"devDependencies": {
Expand Down

0 comments on commit 0c96ee8

Please sign in to comment.