Skip to content

Commit

Permalink
Webpack graphics optim
Browse files Browse the repository at this point in the history
  • Loading branch information
kacperwalter committed Mar 13, 2021
1 parent 01b00b6 commit 622682c
Show file tree
Hide file tree
Showing 7 changed files with 2,156 additions and 13 deletions.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
22 changes: 22 additions & 0 deletions JS/samuraj-programowania/nodejs/webpack4/build/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Webpack4</title>
<link href="main-c37d5cbdd79a99217bb9.css" rel="stylesheet"></head>
<body>

<h1>Nasza strona</h1>

<div class="test-div">No siemaneczko</div>

<div class="lst"></div>

<img src="images/GHM.png" alt="">

<footer>Stopka</footer>

<script type="text/javascript" src="js/e1d2e2.main.js"></script></body>
</html>

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
body{background-color:cadetblue;font-family:Arial, Helvetica, sans-serif}body img{max-width:300px}footer{display:flex;align-items:center;justify-content:center;background-color:#fff;background-image:url(images/zdjecieefee9d.png);color:black;height:80px}

Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,26 @@ const webpackConfig = {
},
{
test: /\.(jpg|png|svg|gif|jpeg)$/,
loader: 'file-loader',
options: {
name: '[name][contenthash:6].[ext]',
outputPath: 'images',
// publicPath - gdzie mają być szukane zdjęcia
// publicPath: '../images',
use: [{
loader: 'file-loader',
options: {
name: '[name][contenthash:6].[ext]',
outputPath: 'images',
// publicPath - gdzie mają być szukane zdjęcia
// publicPath: '../images',
}
}, {
// optymalizacja grafik
// https://www.npmjs.com/package/image-webpack-loader
loader: 'image-webpack-loader',
options: {
mozjpeg: {
quality: 70,
progressive: true,
}
}
}],

}
],
},
Expand Down

0 comments on commit 622682c

Please sign in to comment.