swico 1.7.3-beta.3 → 2.0.0-beta.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.
- package/package.json +7 -13
- package/src/bin.js +6 -6
- package/src/command/build.js +33 -73
- package/src/command/start.js +99 -191
- package/src/config/rsbpack.dev.js +104 -0
- package/src/config/{webpack.base.react.d.ts → rspack.base.react.d.ts} +13 -3
- package/src/config/rspack.base.react.js +193 -0
- package/src/config/{webpack.base.vue.d.ts → rspack.base.vue.d.ts} +13 -1
- package/src/config/rspack.base.vue.js +282 -0
- package/src/config/rspack.prod.js +123 -0
- package/src/index.js +3 -5
- package/src/index.react.js +5 -10
- package/src/index.vue.js +4 -6
- package/src/project-path/.swico-react/$env/history.js +65 -66
- package/src/project-path/.swico-react/$env/index.js +29 -47
- package/src/project-path/.swico-react/loading.js +1 -1
- package/src/project-path/.swico-react/react-hooks.js +24 -37
- package/src/project-path/.swico-vue/$env/history.js +25 -36
- package/src/project-path/.swico-vue/$env/index.js +7 -7
- package/src/project-path/.swico-vue/Container.js +1 -1
- package/src/project-path/.swico-vue/vue-hooks.js +17 -28
- package/src/project-path/src/layout/Layout.js +1 -1
- package/src/project-path/src/layout/index.js +3 -3
- package/src/task.js +13 -58
- package/src/utils/config.js +185 -349
- package/src/utils/tools.js +103 -199
- package/src/config/webpack.base.react.js +0 -315
- package/src/config/webpack.base.vue.js +0 -338
- package/src/config/webpack.dev.js +0 -159
- package/src/config/webpack.prod.js +0 -193
- /package/src/config/{webpack.dev.d.ts → rsbpack.dev.d.ts} +0 -0
- /package/src/config/{webpack.prod.d.ts → rspack.prod.d.ts} +0 -0
|
@@ -1,159 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __assign = (this && this.__assign) || function () {
|
|
3
|
-
__assign = Object.assign || function(t) {
|
|
4
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
-
s = arguments[i];
|
|
6
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
-
t[p] = s[p];
|
|
8
|
-
}
|
|
9
|
-
return t;
|
|
10
|
-
};
|
|
11
|
-
return __assign.apply(this, arguments);
|
|
12
|
-
};
|
|
13
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
14
|
-
if (k2 === undefined) k2 = k;
|
|
15
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
16
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
17
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
18
|
-
}
|
|
19
|
-
Object.defineProperty(o, k2, desc);
|
|
20
|
-
}) : (function(o, m, k, k2) {
|
|
21
|
-
if (k2 === undefined) k2 = k;
|
|
22
|
-
o[k2] = m[k];
|
|
23
|
-
}));
|
|
24
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
25
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
26
|
-
}) : function(o, v) {
|
|
27
|
-
o["default"] = v;
|
|
28
|
-
});
|
|
29
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
30
|
-
if (mod && mod.__esModule) return mod;
|
|
31
|
-
var result = {};
|
|
32
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
33
|
-
__setModuleDefault(result, mod);
|
|
34
|
-
return result;
|
|
35
|
-
};
|
|
36
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
37
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
38
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
39
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
40
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
41
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
42
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
43
|
-
});
|
|
44
|
-
};
|
|
45
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
46
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
47
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
48
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
49
|
-
function step(op) {
|
|
50
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
51
|
-
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
52
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
53
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
54
|
-
switch (op[0]) {
|
|
55
|
-
case 0: case 1: t = op; break;
|
|
56
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
57
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
58
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
59
|
-
default:
|
|
60
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
61
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
62
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
63
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
64
|
-
if (t[2]) _.ops.pop();
|
|
65
|
-
_.trys.pop(); continue;
|
|
66
|
-
}
|
|
67
|
-
op = body.call(thisArg, _);
|
|
68
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
69
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
70
|
-
}
|
|
71
|
-
};
|
|
72
|
-
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
73
|
-
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
74
|
-
if (ar || !(i in from)) {
|
|
75
|
-
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
76
|
-
ar[i] = from[i];
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
return to.concat(ar || Array.prototype.slice.call(from));
|
|
80
|
-
};
|
|
81
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
82
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
83
|
-
};
|
|
84
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
85
|
-
var config_1 = require("../utils/config");
|
|
86
|
-
var path_1 = __importDefault(require("path"));
|
|
87
|
-
var webpack_merge_1 = require("webpack-merge");
|
|
88
|
-
var eslint_webpack_plugin_1 = __importDefault(require("eslint-webpack-plugin"));
|
|
89
|
-
var fork_ts_checker_webpack_plugin_1 = __importDefault(require("fork-ts-checker-webpack-plugin"));
|
|
90
|
-
var tools_1 = require("../utils/tools");
|
|
91
|
-
function default_1(options) {
|
|
92
|
-
var _a, _b, _c, _d, _e;
|
|
93
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
94
|
-
var projectPath, customConfig, templateType, entryPath, env, getBaseConfig, baseConfig, customDevtool;
|
|
95
|
-
return __generator(this, function (_f) {
|
|
96
|
-
switch (_f.label) {
|
|
97
|
-
case 0:
|
|
98
|
-
projectPath = options.projectPath, customConfig = options.customConfig, templateType = options.templateType, entryPath = options.entryPath, env = options.env;
|
|
99
|
-
return [4, Promise.resolve("".concat(templateType === 'vue' ? './webpack.base.vue' : './webpack.base.react')).then(function (s) { return __importStar(require(s)); })];
|
|
100
|
-
case 1:
|
|
101
|
-
getBaseConfig = (_f.sent()).default;
|
|
102
|
-
return [4, getBaseConfig(__assign(__assign({}, options), { env: 'dev' }))];
|
|
103
|
-
case 2:
|
|
104
|
-
baseConfig = _f.sent();
|
|
105
|
-
customDevtool = (_a = customConfig.dev.devtool) !== null && _a !== void 0 ? _a : customConfig.base.devtool;
|
|
106
|
-
return [2, (0, webpack_merge_1.merge)(baseConfig, {
|
|
107
|
-
mode: 'development',
|
|
108
|
-
stats: 'none',
|
|
109
|
-
devtool: templateType === 'vue'
|
|
110
|
-
? customDevtool !== null && customDevtool !== void 0 ? customDevtool : 'cheap-module-source-map'
|
|
111
|
-
: customDevtool !== null && customDevtool !== void 0 ? customDevtool : 'eval-cheap-module-source-map',
|
|
112
|
-
devServer: {
|
|
113
|
-
historyApiFallback: {
|
|
114
|
-
index: "".concat(baseConfig.output.publicPath, "index.html")
|
|
115
|
-
},
|
|
116
|
-
client: {
|
|
117
|
-
logging: 'error',
|
|
118
|
-
progress: false,
|
|
119
|
-
overlay: false
|
|
120
|
-
},
|
|
121
|
-
proxy: (_c = (_b = customConfig === null || customConfig === void 0 ? void 0 : customConfig.dev) === null || _b === void 0 ? void 0 : _b.proxy) !== null && _c !== void 0 ? _c : config_1.initConfig.proxy,
|
|
122
|
-
compress: true,
|
|
123
|
-
hot: true,
|
|
124
|
-
open: false,
|
|
125
|
-
static: {
|
|
126
|
-
directory: path_1.default.join(projectPath, '/public')
|
|
127
|
-
},
|
|
128
|
-
server: customConfig.dev.https === true ? 'https' : 'http'
|
|
129
|
-
},
|
|
130
|
-
plugins: __spreadArray([
|
|
131
|
-
new fork_ts_checker_webpack_plugin_1.default({
|
|
132
|
-
logger: {
|
|
133
|
-
log: function () { },
|
|
134
|
-
error: function (message) {
|
|
135
|
-
tools_1.toast.error(message, { title: 'TypeScript errors' });
|
|
136
|
-
}
|
|
137
|
-
},
|
|
138
|
-
typescript: {
|
|
139
|
-
diagnosticOptions: {
|
|
140
|
-
semantic: true,
|
|
141
|
-
syntactic: true
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
}),
|
|
145
|
-
new eslint_webpack_plugin_1.default({
|
|
146
|
-
context: path_1.default.join(projectPath, '/src'),
|
|
147
|
-
failOnError: false,
|
|
148
|
-
failOnWarning: true,
|
|
149
|
-
extensions: templateType === 'vue' ? ['vue', 'ts', 'js'] : ['tsx', 'ts', 'js'],
|
|
150
|
-
emitWarning: false,
|
|
151
|
-
cache: true
|
|
152
|
-
})
|
|
153
|
-
], ((_e = (_d = customConfig.dev) === null || _d === void 0 ? void 0 : _d.plugins) !== null && _e !== void 0 ? _e : []), true)
|
|
154
|
-
})];
|
|
155
|
-
}
|
|
156
|
-
});
|
|
157
|
-
});
|
|
158
|
-
}
|
|
159
|
-
exports.default = default_1;
|
|
@@ -1,193 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __assign = (this && this.__assign) || function () {
|
|
3
|
-
__assign = Object.assign || function(t) {
|
|
4
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
-
s = arguments[i];
|
|
6
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
-
t[p] = s[p];
|
|
8
|
-
}
|
|
9
|
-
return t;
|
|
10
|
-
};
|
|
11
|
-
return __assign.apply(this, arguments);
|
|
12
|
-
};
|
|
13
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
14
|
-
if (k2 === undefined) k2 = k;
|
|
15
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
16
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
17
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
18
|
-
}
|
|
19
|
-
Object.defineProperty(o, k2, desc);
|
|
20
|
-
}) : (function(o, m, k, k2) {
|
|
21
|
-
if (k2 === undefined) k2 = k;
|
|
22
|
-
o[k2] = m[k];
|
|
23
|
-
}));
|
|
24
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
25
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
26
|
-
}) : function(o, v) {
|
|
27
|
-
o["default"] = v;
|
|
28
|
-
});
|
|
29
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
30
|
-
if (mod && mod.__esModule) return mod;
|
|
31
|
-
var result = {};
|
|
32
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
33
|
-
__setModuleDefault(result, mod);
|
|
34
|
-
return result;
|
|
35
|
-
};
|
|
36
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
37
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
38
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
39
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
40
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
41
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
42
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
43
|
-
});
|
|
44
|
-
};
|
|
45
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
46
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
47
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
48
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
49
|
-
function step(op) {
|
|
50
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
51
|
-
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
52
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
53
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
54
|
-
switch (op[0]) {
|
|
55
|
-
case 0: case 1: t = op; break;
|
|
56
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
57
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
58
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
59
|
-
default:
|
|
60
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
61
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
62
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
63
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
64
|
-
if (t[2]) _.ops.pop();
|
|
65
|
-
_.trys.pop(); continue;
|
|
66
|
-
}
|
|
67
|
-
op = body.call(thisArg, _);
|
|
68
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
69
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
70
|
-
}
|
|
71
|
-
};
|
|
72
|
-
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
73
|
-
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
74
|
-
if (ar || !(i in from)) {
|
|
75
|
-
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
76
|
-
ar[i] = from[i];
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
return to.concat(ar || Array.prototype.slice.call(from));
|
|
80
|
-
};
|
|
81
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
82
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
83
|
-
};
|
|
84
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
85
|
-
var webpack_bundle_analyzer_1 = __importDefault(require("webpack-bundle-analyzer"));
|
|
86
|
-
var copy_webpack_plugin_1 = __importDefault(require("copy-webpack-plugin"));
|
|
87
|
-
var path_1 = __importDefault(require("path"));
|
|
88
|
-
var fs_extra_1 = __importDefault(require("fs-extra"));
|
|
89
|
-
var config_1 = require("../utils/config");
|
|
90
|
-
var webpack_merge_1 = require("webpack-merge");
|
|
91
|
-
var esbuild_loader_1 = require("esbuild-loader");
|
|
92
|
-
var webpackbar_1 = __importDefault(require("webpackbar"));
|
|
93
|
-
var tools_1 = require("../utils/tools");
|
|
94
|
-
var BundleAnalyzerPlugin = webpack_bundle_analyzer_1.default.BundleAnalyzerPlugin;
|
|
95
|
-
var isAnalyze = process.env.ANALYZE === 'true';
|
|
96
|
-
function default_1(options) {
|
|
97
|
-
var _a, _b, _c, _d, _e, _f, _g;
|
|
98
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
99
|
-
var projectPath, customConfig, templateType, getBaseConfig, baseConfig, consoleAvailable, isPublicDirExist, copyConfig, customDevtool;
|
|
100
|
-
return __generator(this, function (_h) {
|
|
101
|
-
switch (_h.label) {
|
|
102
|
-
case 0:
|
|
103
|
-
projectPath = options.projectPath, customConfig = options.customConfig, templateType = options.templateType;
|
|
104
|
-
return [4, Promise.resolve("".concat(templateType === 'vue' ? './webpack.base.vue' : './webpack.base.react')).then(function (s) { return __importStar(require(s)); })];
|
|
105
|
-
case 1:
|
|
106
|
-
getBaseConfig = (_h.sent()).default;
|
|
107
|
-
return [4, getBaseConfig(__assign(__assign({}, options), { env: 'prod' }))];
|
|
108
|
-
case 2:
|
|
109
|
-
baseConfig = _h.sent();
|
|
110
|
-
consoleAvailable = (_b = (_a = customConfig.prod) === null || _a === void 0 ? void 0 : _a.console) !== null && _b !== void 0 ? _b : config_1.initConfig.console;
|
|
111
|
-
return [4, fs_extra_1.default.exists(path_1.default.join(projectPath, '/public'))];
|
|
112
|
-
case 3:
|
|
113
|
-
isPublicDirExist = _h.sent();
|
|
114
|
-
copyConfig = (_d = (_c = customConfig.prod) === null || _c === void 0 ? void 0 : _c.copy) !== null && _d !== void 0 ? _d : config_1.initConfig.copy;
|
|
115
|
-
customDevtool = (_e = customConfig.prod.devtool) !== null && _e !== void 0 ? _e : customConfig.base.devtool;
|
|
116
|
-
return [2, (0, webpack_merge_1.merge)(baseConfig, {
|
|
117
|
-
performance: {
|
|
118
|
-
hints: false
|
|
119
|
-
},
|
|
120
|
-
mode: 'production',
|
|
121
|
-
stats: {
|
|
122
|
-
preset: 'errors-only',
|
|
123
|
-
chunks: true,
|
|
124
|
-
assets: true,
|
|
125
|
-
outputPath: true,
|
|
126
|
-
assetsSort: '!size',
|
|
127
|
-
chunksSort: '!size'
|
|
128
|
-
},
|
|
129
|
-
devtool: customDevtool !== null && customDevtool !== void 0 ? customDevtool : undefined,
|
|
130
|
-
optimization: {
|
|
131
|
-
runtimeChunk: true,
|
|
132
|
-
minimize: true,
|
|
133
|
-
minimizer: [
|
|
134
|
-
new esbuild_loader_1.EsbuildPlugin({
|
|
135
|
-
target: 'es2015',
|
|
136
|
-
css: true,
|
|
137
|
-
minify: true,
|
|
138
|
-
drop: __spreadArray(__spreadArray([], (!consoleAvailable ? ['console'] : []), true), ['debugger'], false)
|
|
139
|
-
})
|
|
140
|
-
],
|
|
141
|
-
splitChunks: {
|
|
142
|
-
chunks: 'all',
|
|
143
|
-
cacheGroups: {
|
|
144
|
-
vendors: {
|
|
145
|
-
test: /[\\/]node_modules[\\/]/,
|
|
146
|
-
priority: -10,
|
|
147
|
-
chunks: 'all',
|
|
148
|
-
reuseExistingChunk: true
|
|
149
|
-
},
|
|
150
|
-
commons: {
|
|
151
|
-
minSize: 0,
|
|
152
|
-
minChunks: 2,
|
|
153
|
-
priority: -20,
|
|
154
|
-
chunks: 'all',
|
|
155
|
-
reuseExistingChunk: true
|
|
156
|
-
}
|
|
157
|
-
}
|
|
158
|
-
}
|
|
159
|
-
},
|
|
160
|
-
plugins: __spreadArray(__spreadArray(__spreadArray(__spreadArray([], (isPublicDirExist || copyConfig.length > 0
|
|
161
|
-
? [
|
|
162
|
-
new copy_webpack_plugin_1.default({
|
|
163
|
-
patterns: __spreadArray(__spreadArray([], (isPublicDirExist ? [path_1.default.join(projectPath, '/public')] : []), true), copyConfig, true)
|
|
164
|
-
})
|
|
165
|
-
]
|
|
166
|
-
: []), true), (isAnalyze
|
|
167
|
-
? [
|
|
168
|
-
new BundleAnalyzerPlugin({
|
|
169
|
-
analyzerMode: 'server',
|
|
170
|
-
analyzerHost: '127.0.0.1',
|
|
171
|
-
analyzerPort: 'auto',
|
|
172
|
-
reportFilename: 'report.html',
|
|
173
|
-
defaultSizes: 'stat',
|
|
174
|
-
openAnalyzer: true,
|
|
175
|
-
generateStatsFile: false,
|
|
176
|
-
statsFilename: 'analyze.json',
|
|
177
|
-
statsOptions: null,
|
|
178
|
-
logLevel: 'info'
|
|
179
|
-
})
|
|
180
|
-
]
|
|
181
|
-
: []), true), [
|
|
182
|
-
new webpackbar_1.default({
|
|
183
|
-
name: 'Swico',
|
|
184
|
-
color: tools_1.colorConfig.theme,
|
|
185
|
-
profile: false
|
|
186
|
-
})
|
|
187
|
-
], false), ((_g = (_f = customConfig.prod) === null || _f === void 0 ? void 0 : _f.plugins) !== null && _g !== void 0 ? _g : []), true)
|
|
188
|
-
})];
|
|
189
|
-
}
|
|
190
|
-
});
|
|
191
|
-
});
|
|
192
|
-
}
|
|
193
|
-
exports.default = default_1;
|
|
File without changes
|
|
File without changes
|