As I dive into the world of webpack, my initial build unearthed an unexpected default file in the output (index 1):
build.js 222 kB 0 [emitted] main
[1] (webpack)/buildin/global.js 509 bytes {0} [built]
[2] ./source/scripts/main.js 105 bytes {0} [built]
+ 4 hidden modules
What is the purpose of this file being included? I can't seem to identify any dependencies in my codebase that would justify the significant amount of code present in my build.js
file. Originally anticipating just a few lines of code in the output, I was surprised to find approximately 8000 lines.
Upon further observation, I noticed that some other projects do not exhibit this file in the output. Is it truly indispensable? Surprisingly, I couldn't locate any reference to it in the documentation.
My webpack.config.js
file for context:
'use strict';
module.exports = {
entry: './source/scripts/main.js',
output: {
path: __dirname + '/dist',
filename: 'build.js'
},
module: {
loaders: [
{
test: /\.js$/,
exclude: /node_modules/
}
]
}
}