Due to the training of Angular 2 during the development of the project, I did not include routing, as I should have. I have a main.js file that loads one component and another main2.js file that loads the second component (now I know that I had to route them from one page, but we are very far from the project that this will cause backup ((will do, if necessary, however)). I am trying to use webpack to bind code for "loadability" (sp?).
Here is my webpack.config.js file:
var path = require( 'path' );
var webpack = require( 'webpack' );
module.exports = {
entry: "./main",
output: {
path: __dirname,
filename: "./dist/bundle.js"
},
resolve: {
extensions: ['.js', '.ts']
},
module: {
loaders: [{
test: /\.ts/, loaders: ['ts-loader'], exclude: /node_modules/
}]
}
};
Is it possible to define two entry points like this:
var path = require( 'path' );
var webpack = require( 'webpack' );
module.exports = {
entry: "./main",
output: {
path: __dirname,
filename: "./dist/bundle.js"
},
resolve: {
extensions: ['.js', '.ts']
},
module: {
loaders: [{
test: /\.ts/, loaders: ['ts-loader'], exclude: /node_modules/
}]
}
};
module.exports = {
entry: "./main2",
output: {
path: __dirname,
filename: "./dist/bundle2.js"
},
resolve: {
extensions: ['.js', '.ts']
},
module: {
loaders: [{
test: /\.ts/, loaders: ['ts-loader'], exclude: /node_modules/
}]
}
};
Or would I rather go back and restructure my project to use routing and have one entry point for me?