Currently, I am utilizing webpack 4 to package my dependencies, specifically AngularJS, in the following manner:
index.js
require('angular');
require('angular-ui-router');
// ...
webpack.config.js
const path = require('path');
module.exports = {
mode: "development",
entry: "./build/index.js",
output: {
path: __dirname + '/public/js',
filename: "bundle.js"
}
}
With this setup, a file named bundle.js
is created containing all the necessary dependencies.
In addition, I am interested in using webpack as a task runner to combine the Angular JS files from the directory /build/js
into a single file (referred to as app.js
) that will be saved within /public/js
.
My ultimate goal is to have the contents of the concatenated angular files (that would typically reside in app.js
) included within bundle.js
, alongside the existing dependencies. However, I am uncertain if this approach is feasible or recommended practice.