Skip to content

Instantly share code, notes, and snippets.

@FazioNico
Last active October 6, 2020 10:57
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save FazioNico/257b6282492e4c24c9343952a1e0b2b5 to your computer and use it in GitHub Desktop.
Save FazioNico/257b6282492e4c24c9343952a1e0b2b5 to your computer and use it in GitHub Desktop.
const path = require('path');
const HtmlWebPackPlugin = require("html-webpack-plugin");
module.exports = {
entry: './src/app/app.js',
output: {
filename: 'main.js',
path: path.resolve(__dirname, 'dist')
},
resolve: {
extensions: ['.js']
},
module: {
rules: [
{
test: /\.html$/,
use: [
{
loader: "html-loader",
// options: { minimize: true }
}
]
},
{
test: [/.css$/],
use:[
'style-loader',
'css-loader'
]
}
]
},
plugins: [
new HtmlWebPackPlugin({
template: "./src/index.html",
filename: "./index.html"
})
]
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment