Skip to content

Commit

Permalink
changed demo to serve without sub-directory
Browse files Browse the repository at this point in the history
  • Loading branch information
liabru committed Sep 15, 2019
1 parent 50cf171 commit 823bbc0
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 14 deletions.
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ which will install the required build dependencies, then run

npm run dev

which will run the development server and opens `http://localhost:8000/demo/index.html` in your browser. Any changes you make to the source will automatically rebuild and reload the page.
which will run the development server and opens `http://localhost:8000/` in your browser. Any changes you make to the source will automatically rebuild and reload the page.

## Commands

Expand Down
22 changes: 11 additions & 11 deletions demo/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,21 @@

<title>Matter.js Demo</title>

<!-- libs -->
<script type="text/javascript" src="/demo/lib/decomp.js"></script>
<script type="text/javascript" src="/demo/lib/pathseg.js"></script>
<!-- Libs -->
<script type="text/javascript" src="./lib/decomp.js"></script>
<script type="text/javascript" src="./lib/pathseg.js"></script>

<!-- Matter -->
<script src="../build/matter.js"></script>

<!-- MatterTools -->
<script src="//code.jquery.com/jquery-3.1.1.js"></script>
<script src="/demo/lib/matter-tools.gui.js"></script>
<script src="/demo/lib/matter-tools.inspector.js"></script>
<script src="/demo/lib/matter-tools.demo.js"></script>
<script src="https://code.jquery.com/jquery-3.1.1.js"></script>
<script src="./lib/matter-tools.gui.js"></script>
<script src="./lib/matter-tools.inspector.js"></script>
<script src="./lib/matter-tools.demo.js"></script>

<!-- Plugins -->
<script src="/demo/lib/matter-wrap.js"></script>
<script src="./lib/matter-wrap.js"></script>

<!-- Examples -->
<script src="../examples/airFriction.js"></script>
Expand Down Expand Up @@ -72,7 +72,7 @@
<script src="../examples/timescale.js"></script>
<script src="../examples/views.js"></script>
<script src="../examples/wreckingBall.js"></script>

<style type="text/css">
* {
box-sizing: border-box;
Expand All @@ -85,6 +85,6 @@
</style>
</head>
<body>
<script src="/demo/js/Demo.js"></script>
<script src="./js/Demo.js"></script>
</body>
</html>
11 changes: 9 additions & 2 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,15 +49,22 @@ module.exports = (env = {}) => {
}
},
devServer: {
contentBase: __dirname,
contentBase: [
path.resolve(__dirname, './demo'),
path.resolve(__dirname, './examples')
],
open: true,
openPage: 'demo/index.html',
openPage: '',
compress: true,
port: 8000,
proxy: {
'/build': {
target: 'http://localhost:8000/',
pathRewrite: { '^/build' : '/' }
},
'/examples': {
target: 'http://localhost:8000/',
pathRewrite: { '^/examples' : '/' }
}
}
}
Expand Down

0 comments on commit 823bbc0

Please sign in to comment.