Comments (3)
Try multiple base directories:
(via https://www.browsersync.io/docs/options/#option-server)
// Multiple base directories
server: {
baseDir: ["src", "node_modules"]
}
from lite-server.
I've just faced a similar issue.
If you include "node_modules" as part of baseDir, it becomes part of the root structure. All files inside node_modules will become directly available to the rest of the application.
Therefore, you should not reference it anymore:
<script src="core-js/client/shim.min.js"></script>
<script src="zone.js/dist/zone.js"></script>
<script src="reflect-metadata/Reflect.js"></script>
<script src="systemjs/dist/system.src.js"></script>
If you want to keep referencing node_modules inside your index.html, a better approach is to add a route in your bs-config.js:
{
"server": { "baseDir": "angular2/system", "routes" : { "/node_modules" : "./node_modules"} }
}
from lite-server.
dir:
app
|-- node_modules
|-- angular2
------|-- system
------------|-- index.html
index.html:
<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>
bs-config.js:
{
"port": 8989,
"server": { "baseDir": ["angular2/system","node_modules"]}
}
error:
[BS] Watching files...
16.07.20 09:04:31 304 GET /index.html
16.07.20 09:04:35 304 GET /styles.css
16.07.20 09:04:35 304 GET /systemjs.config.js
16.07.20 09:04:35 404 GET /node_modules/core-js/client/shim.min.js
16.07.20 09:04:35 404 GET /node_modules/zone.js/dist/zone.js
16.07.20 09:04:35 404 GET /node_modules/reflect-metadata/Reflect.js
16.07.20 09:04:35 404 GET /node_modules/systemjs/dist/system.src.js
BaseDir add more or less, I would like to ask how to configure?
from lite-server.
Related Issues (20)
- Installation fails E429 too many Requests HOT 1
- Not listening on this port
- npm audit found vulnerabilities HOT 1
- npm is not started started script missing HOT 1
- i m trying to run npm start command but it is giving following error
- Problem with npm install HOT 2
- unable to start lite-server on wsl2 HOT 1
- Error using lite-server for create-react-app HOT 3
- The package needs to update axios to solve high severity vulnerability HOT 1
- Disable SPA handling? HOT 1
- lite-server doesn't trigger or reload the page when I save the page after adding something .
- CORS 404 OPTIONS HOT 2
- How to get Directory Listing working?
- Trying to start an html website using NPM and Lite-server HOT 2
- lite-server not installing using (npm install lite-server -g) HOT 1
- Lite-server dependecies are vulnerable (The Async package have a vulnerability)
- lite-server generating three Uncaught (in promise) errors after each reload
- Lite server disables CDN links
- Static files and api proxy HOT 1
- npm & github recommend not using: "All versions of package lite-server are vulnerable to Denial of Service"
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from lite-server.