5htp 0.6.0 → 0.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -312,22 +312,16 @@ export default function createCompiler( app: App, mode: TCompileMode ): webpack.
312
312
  new CssMinimizerPlugin()
313
313
  ]),
314
314
 
315
- // BUG: Essai de charger les plugins depuis app/node_modules
316
- // Et la specification via require() ne sembl epas être supportée ...
317
- // https://webpack.js.org/plugins/image-minimizer-webpack-plugin/
318
315
  /*new ImageMinimizerPlugin({
316
+ // (optional) add generators; you can also just import &format=webp (see below)
319
317
  generator: [
320
318
  {
321
- // You can apply generator using `?as=webp`, you can use any name and provide more options
322
319
  preset: "webp",
323
320
  implementation: ImageMinimizerPlugin.imageminGenerate,
324
- options: {
325
- // Please specify only one plugin here, multiple plugins will not work
326
- plugins: ["imagemin-webp"],
327
- },
328
- },
329
- ],
330
- }),*/
321
+ options: { plugins: ["imagemin-webp"] }
322
+ }
323
+ ]
324
+ })*/
331
325
  ],
332
326
  nodeEnv: 'production',
333
327
  sideEffects: true,
@@ -1,11 +1,10 @@
1
1
  import { staticAssetName } from '../../../paths';
2
2
  import type webpack from 'webpack';
3
- import type App from '../../../app';
4
3
 
5
4
  module.exports = (app: App, dev: boolean, client: boolean): webpack.RuleSetRule[] => {
6
5
 
7
6
  return [{
8
- test: /\.(bmp|gif|jpg|jpeg|png|ico|svg|webp)$/,
7
+ test: /\.(bmp|gif|png|jpg|jpegico|svg|webp)$/,
9
8
  type: 'asset',
10
9
  parser: {
11
10
  dataUrlCondition: {
@@ -17,6 +16,19 @@ module.exports = (app: App, dev: boolean, client: boolean): webpack.RuleSetRule[
17
16
  }
18
17
 
19
18
  }, {
19
+ test: /\.(jpg|jpeg|png)$/i,
20
+ type: "javascript/auto",
21
+ use: [{
22
+ loader: "responsive-loader",
23
+ options: {
24
+ sizes: [320, 480, 640, 768, 1024, 1300],
25
+ placeholder: true,
26
+ placeholderSize: 20,
27
+ quality: 100,
28
+ publicPath: '/public'
29
+ }
30
+ }]
31
+ }, {
20
32
  test: /\.(webm|mp4|avi|mpk|mov|mkv)$/,
21
33
  type: 'asset/resource',
22
34
  },]
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "5htp",
3
3
  "description": "Convenient TypeScript framework designed for Performance and Productivity.",
4
- "version": "0.6.0",
4
+ "version": "0.6.1",
5
5
  "author": "Gaetan Le Gac (https://github.com/gaetanlegac)",
6
6
  "repository": "git://github.com/gaetanlegac/5htp.git",
7
7
  "license": "MIT",
@@ -54,10 +54,7 @@
54
54
  "dayjs": "^1.11.5",
55
55
  "favicons": "^7.2.0",
56
56
  "filesize": "^8.0.3",
57
- "image-minimizer-webpack-plugin": "^2.2.0",
58
- "imagemin": "^8.0.1",
59
57
  "imagemin-svgo": "^10.0.0",
60
- "imagemin-webp": "^6.0.0",
61
58
  "json5": "^2.2.0",
62
59
  "less-loader": "^10.0.1",
63
60
  "less-vars-to-js": "^1.3.0",
@@ -91,6 +88,11 @@
91
88
  "@types/node": "^16.9.1",
92
89
  "@types/nodemailer": "^6.4.4",
93
90
  "@types/prompts": "^2.0.14",
94
- "@types/webpack-env": "^1.16.2"
91
+ "@types/webpack-env": "^1.16.2",
92
+ "image-minimizer-webpack-plugin": "^4.1.4",
93
+ "imagemin": "^9.0.1",
94
+ "imagemin-webp": "^6.0.0",
95
+ "responsive-loader": "^3.1.2",
96
+ "sharp": "^0.34.3"
95
97
  }
96
98
  }