const path = require('path');
module.exports = {
entry:'./src/index.js',
output: {
path: 'path.resolve(__dirname, 'build')',
filename: 'bundle.js'
}
}
module.exports = {
entry: './path/to/my/entry/file.js'
};const path = require('path');
module.exports = {
entry: './path/to/my/entry/file.js',
output: {
path: path.resolve(__dirname, 'dist'),
filename: 'bundle.js'
}
};
module: {
output: {
filename: 'my-first-webpack.bundle.js'
},
rules: [
{ test: /\.js$/, use: ‘babel-loader’ },
{ test: /\.css$/, use: ‘css-loader’ }
],
}
module.exports = {
module: {
rules: [
{
test: /\.scss$/,
use: ['style-loader', 'css-loader', 'sass-loader']
}
],
},
};styleLoader(cssLoader(sassLoader("source")))module: {
output: {
filename: 'my-first-webpack.bundle.js'
},
rules: [
{ test: /\.js$/, use: ‘babel-loader’ },
{ test: /\.css$/, use: ‘css-loader’ }
],
}
const HtmlWebpackPlugin = require('html-webpack-plugin');
const webpack = require('webpack');
module.exports = {
plugins: [
new webpack.optimize.UglifyJsPlugin(),
new HtmlWebpackPlugin({template: './src/index.html'})
]
};module.exports = {
mode: 'production'
};