const path = require('path');
const htmlWebpackPlugin = require('html-webpack-plugin');
module.exports = {
entry: path.resolve(__dirname, './src/index.js'),
output: {
path: path.resolve(__dirname, 'dist'),
filename: '[name][contenthash].js',
assetModuleFilename: '[name][ext]',
clean: true
},
performance: {
hints: false,
maxAssetSize: 512000,
maxEntrypointSize: 512000
},
devServer: {
static: {
directory: path.join(__dirname, 'src/index.js'),
},
compress: true,
port: 9000,
},
module: {
rules: [
{
test: /\.scss$/,
use: ['style-loader', 'css-loader', 'sass-loader']
},
{
test: /\.(svg|jpg|jpeg|gif|png)$/i,
type: 'asset/resource'
},
{
test: /\.(?:js|mjs|cjs)$/,
exclude: /node_modules/,
use: {
loader: 'babel-loader',
options: {
presets: [
['@babel/preset-env', { targets: "defaults" }]
]
}
}
}
]
},
plugins: [
new htmlWebpackPlugin ({
filename: "index.html",
title: 'bubbel',
template: 'src/index.html'
})
],
mode: 'production'
}
git rm --cached `git ls-files -i - c --exclude-from=.gitignore`