0
0
Fork 0
mirror of https://github.com/liabru/matter-js.git synced 2024-12-24 13:29:01 -05:00

changed demo to serve without sub-directory

This commit is contained in:
liabru 2019-09-15 18:34:04 +01:00
parent 50cf171c8a
commit 823bbc0b5f
3 changed files with 21 additions and 14 deletions

View file

@ -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

View file

@ -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>
@ -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;
@ -85,6 +85,6 @@
</style>
</head>
<body>
<script src="/demo/js/Demo.js"></script>
<script src="./js/Demo.js"></script>
</body>
</html>

View file

@ -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' : '/' }
}
}
}