I am trying to run my application using the lite-server
node package but it won't load scripts from the parent directory.
I want my index.html
in the /src
folder because it could be possible in the future to generate a different file to /dist
. /node_modules
and systemjs.config.js
need to stay in the root directory as they won't change.
File structure:
The src/index.html
:
<html>
<head>
<base href="/">
<title>task manager</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="styles.css">
<!-- 1. Load libraries -->
<!-- Polyfill(s) for older browsers -->
<script src="../node_modules/core-js/client/shim.min.js"></script>
<script src="../node_modules/zone.js/dist/zone.js"></script>
<script src="../node_modules/reflect-metadata/Reflect.js"></script>
<script src="../node_modules/systemjs/dist/system.src.js"></script>
<!-- 2. Configure SystemJS -->
<script src="../systemjs.config.js"></script>
<script>
System.import('app').catch(function(err){ console.error(err); });
</script>
</head>
<!-- 3. Display the application -->
<body>
<my-app>Loading...</my-app>
</body>
</html>
Running lite-server inside the /src
dir:
The node modules do exist. If I move the required files to the child directory itself, /src
, the server runs fine with no 404s. Is this a problem with my lite-server or systemjs settings?