@umijs/bundler-webpack 4.0.0-rc.14 → 4.0.0-rc.17

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.
Files changed (39) hide show
  1. package/dist/build.js +48 -59
  2. package/dist/cli.js +6 -15
  3. package/dist/client/client.js +34 -47
  4. package/dist/config/_sampleFeature.js +6 -17
  5. package/dist/config/assetRules.js +44 -55
  6. package/dist/config/bundleAnalyzerPlugin.js +12 -23
  7. package/dist/config/compressPlugin.js +68 -76
  8. package/dist/config/config.js +177 -185
  9. package/dist/config/copyPlugin.js +29 -40
  10. package/dist/config/cssRules.js +93 -83
  11. package/dist/config/definePlugin.js +11 -19
  12. package/dist/config/detectDeadCodePlugin.js +16 -21
  13. package/dist/config/fastRefreshPlugin.js +11 -22
  14. package/dist/config/forkTSCheckerPlugin.js +11 -22
  15. package/dist/config/harmonyLinkingErrorPlugin.js +3 -14
  16. package/dist/config/ignorePlugin.js +10 -21
  17. package/dist/config/javaScriptRules.js +151 -162
  18. package/dist/config/manifestPlugin.js +10 -18
  19. package/dist/config/miniCSSExtractPlugin.js +12 -23
  20. package/dist/config/nodePolyfill.js +14 -21
  21. package/dist/config/nodePrefixPlugin.js +8 -19
  22. package/dist/config/progressPlugin.js +7 -18
  23. package/dist/config/purgecssWebpackPlugin.js +15 -26
  24. package/dist/config/speedMeasureWebpackPlugin.js +12 -23
  25. package/dist/config/svgRules.js +43 -47
  26. package/dist/dev.js +101 -112
  27. package/dist/loader/svgr.js +4 -13
  28. package/dist/loader/swc.js +9 -14
  29. package/dist/plugins/ESBuildCSSMinifyPlugin.js +23 -34
  30. package/dist/plugins/ParcelCSSMinifyPlugin.js +30 -32
  31. package/dist/plugins/RuntimePublicPathPlugin.js +1 -1
  32. package/dist/schema.js +18 -6
  33. package/dist/server/server.d.ts +1 -1
  34. package/dist/server/server.js +161 -170
  35. package/dist/server/ws.d.ts +1 -1
  36. package/dist/types.d.ts +2 -6
  37. package/package.json +9 -11
  38. package/dist/server/https.d.ts +0 -4
  39. package/dist/server/https.js +0 -74
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@umijs/bundler-webpack",
3
- "version": "4.0.0-rc.14",
3
+ "version": "4.0.0-rc.17",
4
4
  "description": "@umijs/bundler-webpack",
5
5
  "homepage": "https://github.com/umijs/umi-next/tree/master/packages/bundler-webpack#readme",
6
6
  "bugs": "https://github.com/umijs/umi-next/issues",
@@ -29,28 +29,26 @@
29
29
  "test": "umi-scripts jest-turbo"
30
30
  },
31
31
  "dependencies": {
32
- "@parcel/css": "1.8.1",
32
+ "@parcel/css": "1.8.2",
33
33
  "@pmmmwh/react-refresh-webpack-plugin": "0.5.5",
34
34
  "@svgr/core": "6.2.1",
35
35
  "@svgr/plugin-jsx": "^6.2.1",
36
36
  "@svgr/plugin-svgo": "^6.2.0",
37
37
  "@types/hapi__joi": "17.1.8",
38
- "@umijs/babel-preset-umi": "4.0.0-rc.14",
39
- "@umijs/bundler-utils": "4.0.0-rc.14",
40
- "@umijs/mfsu": "4.0.0-rc.14",
41
- "@umijs/utils": "4.0.0-rc.14",
38
+ "@umijs/babel-preset-umi": "4.0.0-rc.17",
39
+ "@umijs/bundler-utils": "4.0.0-rc.17",
40
+ "@umijs/mfsu": "4.0.0-rc.17",
41
+ "@umijs/utils": "4.0.0-rc.17",
42
42
  "css-loader": "6.7.1",
43
43
  "es5-imcompatible-versions": "^0.1.73",
44
44
  "jest-worker": "27.5.1",
45
45
  "node-libs-browser": "2.2.1",
46
- "postcss": "^8.4.12",
47
- "postcss-preset-env": "7.4.3",
48
- "react-error-overlay": "6.0.9",
49
- "spdy": "^4.0.2"
46
+ "postcss": "^8.4.13",
47
+ "postcss-preset-env": "7.5.0",
48
+ "react-error-overlay": "6.0.9"
50
49
  },
51
50
  "devDependencies": {
52
51
  "@swc/core": "1.2.165",
53
- "@types/spdy": "^3.4.5",
54
52
  "@types/webpack-sources": "3.2.0",
55
53
  "@types/ws": "8.5.3",
56
54
  "autoprefixer": "10.4.4",
@@ -1,4 +0,0 @@
1
- /// <reference types="node" />
2
- import { RequestListener } from 'http';
3
- import { HttpsParams } from '../types';
4
- export declare function createHttpsServer(app: RequestListener, httpsConfig: HttpsParams): Promise<import("https").Server>;
@@ -1,74 +0,0 @@
1
- "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- var __importDefault = (this && this.__importDefault) || function (mod) {
12
- return (mod && mod.__esModule) ? mod : { "default": mod };
13
- };
14
- Object.defineProperty(exports, "__esModule", { value: true });
15
- exports.createHttpsServer = void 0;
16
- const utils_1 = require("@umijs/utils");
17
- const fs_1 = require("fs");
18
- const path_1 = require("path");
19
- const spdy_1 = __importDefault(require("spdy"));
20
- const defaultHttpsHosts = ['localhost', '127.0.0.1'];
21
- function createHttpsServer(app, httpsConfig) {
22
- return __awaiter(this, void 0, void 0, function* () {
23
- utils_1.logger.wait('[HTTPS] Starting service in https mode...');
24
- // Check if mkcert is installed
25
- try {
26
- yield utils_1.execa.execa('mkcert', ['--version']);
27
- }
28
- catch (e) {
29
- utils_1.logger.error('[HTTPS] The mkcert has not been installed.');
30
- utils_1.logger.info('[HTTPS] Please follow the guide to install manually.');
31
- switch (process.platform) {
32
- case 'darwin':
33
- console.log(utils_1.chalk.green('$ brew install mkcert'));
34
- console.log(utils_1.chalk.gray('# If you use firefox, please install nss.'));
35
- console.log(utils_1.chalk.green('$ brew install nss'));
36
- console.log(utils_1.chalk.green('$ mkcert -install'));
37
- break;
38
- case 'win32':
39
- console.log(utils_1.chalk.green('Checkout https://github.com/FiloSottile/mkcert#windows'));
40
- break;
41
- case 'linux':
42
- console.log(utils_1.chalk.green('Checkout https://github.com/FiloSottile/mkcert#linux'));
43
- break;
44
- default:
45
- break;
46
- }
47
- throw new Error(`[HTTPS] mkcert not found.`);
48
- }
49
- let { key, cert, hosts } = httpsConfig;
50
- hosts = hosts || defaultHttpsHosts;
51
- if (!key || !cert) {
52
- key = (0, path_1.join)(__dirname, 'umi.key.pem');
53
- cert = (0, path_1.join)(__dirname, 'umi.pem');
54
- }
55
- // Generate cert and key files if they are not exist.
56
- if (!(0, fs_1.existsSync)(key) || !(0, fs_1.existsSync)(cert)) {
57
- utils_1.logger.wait('[HTTPS] Generating cert and key files...');
58
- yield utils_1.execa.execa('mkcert', [
59
- '-cert-file',
60
- cert,
61
- '-key-file',
62
- key,
63
- ...hosts,
64
- ]);
65
- }
66
- // Create server
67
- const http2Service = spdy_1.default.createServer({
68
- key: (0, fs_1.readFileSync)(key, 'utf-8'),
69
- cert: (0, fs_1.readFileSync)(cert, 'utf-8'),
70
- }, app);
71
- return http2Service;
72
- });
73
- }
74
- exports.createHttpsServer = createHttpsServer;