5htp 0.3.5 → 0.3.6

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.
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.3.5",
4
+ "version": "0.3.6",
5
5
  "author": "Gaetan Le Gac (https://github.com/gaetanlegac)",
6
6
  "repository": "git://github.com/gaetanlegac/5htp.git",
7
7
  "license": "MIT",
@@ -73,7 +73,6 @@
73
73
  "ts-alias": "^0.0.7",
74
74
  "ts-node": "^10.9.1",
75
75
  "webfont": "^11.2.26",
76
- "webpack": "^5.56.0",
77
76
  "webpack-assets-manifest": "^5.0.6",
78
77
  "webpack-bundle-analyzer": "^4.4.2",
79
78
  "webpack-dev-middleware": "^5.1.0",
@@ -82,11 +81,13 @@
82
81
  "webpack-virtual-modules": "^0.4.3"
83
82
  },
84
83
  "devDependencies": {
84
+ "@types/babel__preset-env": "^7.9.6",
85
85
  "@types/favicons": "^6.2.2",
86
86
  "@types/fs-extra": "^9.0.12",
87
87
  "@types/node": "^16.9.1",
88
88
  "@types/nodemailer": "^6.4.4",
89
89
  "@types/prompts": "^2.0.14",
90
- "@types/webpack-env": "^1.16.2"
90
+ "@types/webpack-env": "^1.16.2",
91
+ "webpack": "^5.89.0"
91
92
  }
92
93
  }
@@ -3,11 +3,8 @@
3
3
  ----------------------------------*/
4
4
 
5
5
  // Npm
6
- import path from 'path';
7
6
  import type webpack from 'webpack';
8
- import * as types from '@babel/types'
9
- import PresetReact from '@babel/preset-react';
10
-
7
+ import PresetBabel, { Options } from '@babel/preset-env';
11
8
  // Core
12
9
  import PluginIndexage from '../plugins/indexage';
13
10
 
@@ -18,6 +15,32 @@ import type { TAppSide, App } from '@cli/app';
18
15
  - REGLES
19
16
  ----------------------------------*/
20
17
  module.exports = (app: App, side: TAppSide, dev: boolean): webpack.RuleSetRule[] => {
18
+
19
+ const babelPresetEnvConfig: Options = side === 'client' ? {
20
+
21
+ // Ajoute automatiquement les polyfills babel
22
+ // https://stackoverflow.com/a/61517521/12199605
23
+ "useBuiltIns": "usage", // alternative mode: "entry"
24
+ "corejs": 3, // default would be 2
25
+
26
+ targets: {
27
+ browsers: dev
28
+ ? 'last 2 versions'
29
+ : app.packageJson.browserslist,
30
+ },
31
+ forceAllTransforms: !dev, // for UglifyJS
32
+ modules: false,
33
+ debug: false,
34
+ bugfixes: !dev
35
+ } : {
36
+ targets: {
37
+ node: true,//pkg.engines.node.match(/(\d+\.?)+/)[0],
38
+ },
39
+ modules: false,
40
+ useBuiltIns: false,
41
+ debug: false,
42
+ }
43
+
21
44
  return [{
22
45
  loader: 'babel-loader',
23
46
  options: {
@@ -40,27 +63,7 @@ module.exports = (app: App, side: TAppSide, dev: boolean): webpack.RuleSetRule[]
40
63
  presets: [
41
64
 
42
65
  // https://github.com/babel/babel-preset-env
43
- [require('@babel/preset-env'), side === 'client' ? {
44
-
45
- // Ajoute automatiquement les polyfills babel
46
- // https://stackoverflow.com/a/61517521/12199605
47
- "useBuiltIns": "usage", // alternative mode: "entry"
48
- "corejs": 3, // default would be 2
49
-
50
- targets: {
51
- browsers: app.packageJson.browserslist,
52
- },
53
- forceAllTransforms: !dev, // for UglifyJS
54
- modules: false,
55
- debug: false,
56
- } : {
57
- targets: {
58
- node: true,//pkg.engines.node.match(/(\d+\.?)+/)[0],
59
- },
60
- modules: false,
61
- useBuiltIns: false,
62
- debug: false,
63
- }],
66
+ [PresetBabel, babelPresetEnvConfig],
64
67
 
65
68
  [require("@babel/preset-typescript"), {
66
69
  useDefineForClassFields: true,