I am developing a MEAN app and my folder structure is as follows:
I have added a js file under /angular/src/assets/js for some jQuery things.
For that I have installed jQuery using npm.
Now I need to call that js file through angular.cli.json file.
angular.cli.json:
"apps": [
{
"root": "angular/src",
"outDir": "angular/dist",
"assets": [
"assets",
"favicon.ico"
],
"index": "index.html",
"main": "main.ts",
"polyfills": "polyfills.ts",
"test": "test.ts",
"tsconfig": "tsconfig.app.json",
"testTsconfig": "tsconfig.spec.json",
"prefix": "app",
"styles": [
"styles.css"
],
"scripts": [
"../node_modules/jquery/dist/jquery.min.js",
"../src/assets/js/custom.js"
],
Since I am pointing the root to "angular/src", there is a problem of including the jquery.min.js in the scripts part which is located under "mean/node_modules/" and ends in "not found" error.
angular.cli.json file looking for "node_modules/jquery/dist/jquery.min.js" inside the "angular/src" root path.
Is there any way to solve this without changing my folder structure?
Need someone's valuable help.