A static module bundler for modern JavaScript applications.
...recursively builds a dependency graph that includes every module ... then packages all of those modules into one or more bundles.
Good authors divide their books into chapters and sections; good programmers divide their programs into modules.
JS
JS
JS
JS
JS
JS
JS
JS
JS
JS
JS
JS
JS
JS
JS
JS
JS
JS
JS
JS
JS
JS
JS
JS
JS
JS
JS
JS
CSS
IMG
D
C
B
A
Entry
Entry
Output
Entry
Output
Loaders
Entry
Output
Loaders
Plugins
const path = require('path');
const HtmlPlugin = require('html-webpack-plugin');
module.exports = {
entry: './src/index.js',
output: {
path: path.resolve(__dirname, 'dist'),
filename: 'bundle.js'
},
module: {
rules: [
{
test: /\.js$/,
exclude: /node_modules/,
use: [ 'babel-loader' ]
}
]
},
plugins: [
new HtmlPlugin({
template: "./html/index.html"
})
]
};
const path = require('path');
const HtmlPlugin = require('html-webpack-plugin');
module.exports = {
entry: './src/index.js',
output: {
path: path.resolve(__dirname, 'dist'),
filename: 'bundle.js'
},
module: {
rules: [
{
test: /\.js$/,
exclude: /node_modules/,
use: [ 'babel-loader' ]
}
]
},
plugins: [
new HtmlPlugin({
template: "./html/index.html"
})
]
};
const path = require('path');
const HtmlPlugin = require('html-webpack-plugin');
module.exports = {
entry: './src/index.js',
output: {
path: path.resolve(__dirname, 'dist'),
filename: 'bundle.js'
},
module: {
rules: [
{
test: /\.js$/,
exclude: /node_modules/,
use: [ 'babel-loader' ]
}
]
},
plugins: [
new HtmlPlugin({
template: "./html/index.html"
})
]
};
const path = require('path');
const HtmlPlugin = require('html-webpack-plugin');
module.exports = {
entry: './src/index.js',
output: {
path: path.resolve(__dirname, 'dist'),
filename: 'bundle.js'
},
module: {
rules: [
{
test: /\.js$/,
exclude: /node_modules/,
use: [ 'babel-loader' ]
}
]
},
plugins: [
new HtmlPlugin({
template: "./html/index.html"
})
]
};
const path = require('path');
const HtmlPlugin = require('html-webpack-plugin');
module.exports = {
entry: './src/index.js',
output: {
path: path.resolve(__dirname, 'dist'),
filename: 'bundle.js'
},
module: {
rules: [
{
test: /\.js$/,
exclude: /node_modules/,
use: [ 'babel-loader' ]
}
]
},
plugins: [
new HtmlPlugin({
template: "./html/index.html"
})
]
};