In my development setup using VS 2015, ASP.net vnext, Angular 2, Typescript, and gulp.js, I have successfully automated the process of moving my scripts/**/*.ts
files to the wwwroot/app
folder. Now, I am looking to extend this automation to include my libraries such as Angular 2. Essentially, I want a gulp task that will:
- Inject
angular.js
intoindex.html
within the
node<environment names="Development">
- Inject
angular.min.js
intoindex.html
within the
node<environment names="Production">
The key requirement here is for this process to be dynamic and work seamlessly with all libraries in my project:
<any>.min.js
(for production)<any>.js
(for development)
I am capable of handling the minification of any.js
myself. However, implementing this using data from the dependencies
in the package.json
file has proven challenging for me.
Therefore, I am seeking guidance on whether there are existing tools or approaches to streamline this process. Should I break down the workflow into manual steps, such as manually copying and pasting certain libraries? Or could I possibly extract the name of the dependencies and append them with .js
, then retrieve these files from the node_modules
folder (although this approach feels hacky and potentially unsafe)?
UPDATE
Rephrased/Clarified question:
How can I automatically incorporate my npm dependencies
(excluding devDependencies
) into the "Development"
environment node when triggering specific events like build/clear processes?