Created by DevandScorp
module.exports = {
entry: './src/index.js',
output: {
filename: 'main.js',
path: path.resolve(__dirname, 'dist')
}
};
npm webpack --config webpack.config.js
module: {
rules: [
{
test: /\.css$/,
use: [
'style-loader',
'css-loader'
]
},
{
test: /\.(png|svg|jpg|gif)$/,
use: [
'file-loader'
]
},
{
test: /\.(woff|woff2|eot|ttf|otf)$/,
use: [
'file-loader'
]
}
]
}
plugins: [
new webpack.optimize.UglifyJsPlugin(),
new HtmlWebpackPlugin({template: './src/index.html'})
]
module.exports = {
mode: 'development'
};
devtool: 'inline-source-map'
watch mode
webpack-dev-server
webpack-dev-middleware
 UglifyJsPlugin
ModuleConcatenationPlugin
NoEmitOnErrorsPlugin