Skip to content

Commit

Permalink
add matter-wrap as dev dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
liabru committed Jan 28, 2021
1 parent 7b00354 commit ef7c4c6
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 7 deletions.
10 changes: 7 additions & 3 deletions examples/avalanche.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
var Example = Example || {};

Example.avalanche = function() {
Matter.use(
'matter-wrap'
);
if (typeof require !== 'undefined') {
// either require the plugin directly (Node.js, Webpack etc.)
Matter.use(require('matter-wrap'));
} else {
// or by name from plugin registry (Browser global)
Matter.use('matter-wrap');
}

var Engine = Matter.Engine,
Render = Matter.Render,
Expand Down
10 changes: 7 additions & 3 deletions examples/ballPool.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
var Example = Example || {};

Example.ballPool = function() {
Matter.use(
'matter-wrap'
);
if (typeof require !== 'undefined') {
// either require the plugin directly (Node.js, Webpack etc.)
Matter.use(require('matter-wrap'));
} else {
// or by name from plugin registry (Browser global)
Matter.use('matter-wrap');
}

var Engine = Matter.Engine,
Render = Matter.Render,
Expand Down
6 changes: 6 additions & 0 deletions package-lock.json

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

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
"jest-worker": "^24.9.0",
"json-stringify-pretty-compact": "^2.0.0",
"matter-tools": "^0.12.3",
"matter-wrap": "^0.2.0",
"pathseg": "^1.2.0",
"poly-decomp": "^0.3.0",
"puppeteer-core": "^5.5.0",
Expand All @@ -39,7 +40,7 @@
"build-alpha": "webpack --mode=production --env.ALPHA & webpack --mode=production --env.MINIMIZE --env.ALPHA",
"build-examples": "webpack --config webpack.examples.config.js --mode=production & webpack --config webpack.examples.config.js --mode=production --env.MINIMIZE",
"build-examples-alpha": "webpack --config webpack.examples.config.js --mode=production --env.ALPHA & webpack --config webpack.examples.config.js --mode=production --env.MINIMIZE --env.ALPHA",
"build-demo": "mkdir -p demo/lib && cp node_modules/matter-tools/build/matter-tools.demo.js demo/lib & cp node_modules/matter-tools/build/matter-tools.gui.js demo/lib & cp node_modules/matter-tools/build/matter-tools.inspector.js demo/lib & cp node_modules/pathseg/pathseg.js demo/lib & cp node_modules/poly-decomp/build/decomp.js demo/lib",
"build-demo": "mkdir -p demo/lib && cp node_modules/matter-tools/build/matter-tools.demo.js demo/lib & cp node_modules/matter-tools/build/matter-tools.gui.js demo/lib & cp node_modules/matter-tools/build/matter-tools.inspector.js demo/lib & cp node_modules/pathseg/pathseg.js demo/lib & cp node_modules/poly-decomp/build/decomp.js demo/lib & cp node_modules/matter-wrap/build/matter-wrap.js demo/lib",
"lint": "eslint 'src/**/*.js' 'demo/js/Demo.js' 'demo/js/Compare.js' 'examples/*.js' 'webpack.*.js'",
"doc": "yuidoc --config yuidoc.json --project-version $npm_package_version",
"test": "npm run test-node",
Expand Down
6 changes: 6 additions & 0 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,12 @@ License ${pkg.license}${!minimize ? '\n\n' + license : ''}`;
commonjs2: 'poly-decomp',
amd: 'poly-decomp',
root: 'decomp'
},
'matter-wrap': {
commonjs: 'matter-wrap',
commonjs2: 'matter-wrap',
amd: 'matter-wrap',
root: 'MatterWrap'
}
};

Expand Down
6 changes: 6 additions & 0 deletions webpack.examples.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,12 @@ License ${pkg.license}${!minimize ? '\n\n' + license : ''}`;
commonjs2: 'matter-js',
amd: 'matter-js',
root: 'Matter'
},
'matter-wrap': {
commonjs: 'matter-wrap',
commonjs2: 'matter-wrap',
amd: 'matter-wrap',
root: 'MatterWrap'
}
}
};
Expand Down

0 comments on commit ef7c4c6

Please sign in to comment.