Angular5 - specifying css or javascript asset for bundling to deployed offline



Say you have a bunch of css and javascript files which you need to deploy as offline asset. Meaning the target server does not have access to internet. What do you do?

You can change your ".angular-cli.json" file and under the section "styles", update path to your assets in src folder. Yeap, it starts looking in your src folder and you can tell I have a folder called "assets".




"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", "assets/bootstrap.css"
],
"scripts": ["assets/jquery-3.2.1.slim.min.js", "assets/popper.min.js", "assets/bootstrap.min.js"],
"environmentSource": "environments/environment.ts",
"environments": {
"dev": "environments/environment.ts",
"prod": "environments/environment.prod.ts"
}
}
],



Comments

Popular posts from this blog

The specified initialization vector (IV) does not match the block size for this algorithm