1 | module.exports =
|
2 | (function() {
|
3 | "use strict";
|
4 | var __webpack_modules__ = ({
|
5 |
|
6 | 787:
|
7 | (function(__unused_webpack_module, exports, __nccwpck_require__) {
|
8 |
|
9 |
|
10 |
|
11 | Object.defineProperty(exports, "__esModule", ({
|
12 | value: true
|
13 | }));
|
14 | exports.default = void 0;
|
15 |
|
16 | var _terser = __nccwpck_require__(775);
|
17 |
|
18 | function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
|
19 |
|
20 | function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
21 |
|
22 | function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
23 |
|
24 | const buildTerserOptions = ({
|
25 | ecma,
|
26 | warnings,
|
27 | parse = {},
|
28 | compress = {},
|
29 | mangle,
|
30 | module,
|
31 | output,
|
32 | toplevel,
|
33 | nameCache,
|
34 | ie8,
|
35 |
|
36 |
|
37 | keep_classnames,
|
38 | keep_fnames,
|
39 |
|
40 |
|
41 | safari10
|
42 | } = {}) => ({
|
43 | ecma,
|
44 | warnings,
|
45 | parse: _objectSpread({}, parse),
|
46 | compress: typeof compress === 'boolean' ? compress : _objectSpread({}, compress),
|
47 |
|
48 | mangle: mangle == null ? true : typeof mangle === 'boolean' ? mangle : _objectSpread({}, mangle),
|
49 | output: _objectSpread({
|
50 | shebang: true,
|
51 | comments: false,
|
52 | beautify: false,
|
53 | semicolons: true
|
54 | }, output),
|
55 | module,
|
56 |
|
57 | sourceMap: null,
|
58 | toplevel,
|
59 | nameCache,
|
60 | ie8,
|
61 | keep_classnames,
|
62 | keep_fnames,
|
63 | safari10
|
64 | });
|
65 |
|
66 | const buildComments = (options, terserOptions, extractedComments) => {
|
67 | const condition = {};
|
68 | const commentsOpts = terserOptions.output.comments;
|
69 |
|
70 | if (typeof options.extractComments === 'boolean') {
|
71 | condition.preserve = commentsOpts;
|
72 | condition.extract = /^\**!|@preserve|@license|@cc_on/i;
|
73 | } else if (typeof options.extractComments === 'string' || options.extractComments instanceof RegExp) {
|
74 |
|
75 | condition.preserve = commentsOpts;
|
76 | condition.extract = options.extractComments;
|
77 | } else if (typeof options.extractComments === 'function') {
|
78 | condition.preserve = commentsOpts;
|
79 | condition.extract = options.extractComments;
|
80 | } else if (Object.prototype.hasOwnProperty.call(options.extractComments, 'condition')) {
|
81 |
|
82 | condition.preserve = commentsOpts;
|
83 | condition.extract = options.extractComments.condition;
|
84 | } else {
|
85 |
|
86 | condition.preserve = false;
|
87 | condition.extract = commentsOpts;
|
88 | }
|
89 |
|
90 |
|
91 | ['preserve', 'extract'].forEach(key => {
|
92 | let regexStr;
|
93 | let regex;
|
94 |
|
95 | switch (typeof condition[key]) {
|
96 | case 'boolean':
|
97 | condition[key] = condition[key] ? () => true : () => false;
|
98 | break;
|
99 |
|
100 | case 'function':
|
101 | break;
|
102 |
|
103 | case 'string':
|
104 | if (condition[key] === 'all') {
|
105 | condition[key] = () => true;
|
106 |
|
107 | break;
|
108 | }
|
109 |
|
110 | if (condition[key] === 'some') {
|
111 | condition[key] = (astNode, comment) => {
|
112 | return comment.type === 'comment2' && /^\**!|@preserve|@license|@cc_on/i.test(comment.value);
|
113 | };
|
114 |
|
115 | break;
|
116 | }
|
117 |
|
118 | regexStr = condition[key];
|
119 |
|
120 | condition[key] = (astNode, comment) => {
|
121 | return new RegExp(regexStr).test(comment.value);
|
122 | };
|
123 |
|
124 | break;
|
125 |
|
126 | default:
|
127 | regex = condition[key];
|
128 |
|
129 | condition[key] = (astNode, comment) => regex.test(comment.value);
|
130 |
|
131 | }
|
132 | });
|
133 |
|
134 |
|
135 | return (astNode, comment) => {
|
136 | if (condition.extract(astNode, comment)) {
|
137 | const commentText = comment.type === 'comment2' ? `/*${comment.value}*/` : `//${comment.value}`;
|
138 |
|
139 | if (!extractedComments.includes(commentText)) {
|
140 | extractedComments.push(commentText);
|
141 | }
|
142 | }
|
143 |
|
144 | return condition.preserve(astNode, comment);
|
145 | };
|
146 | };
|
147 |
|
148 | const minify = options => {
|
149 | const {
|
150 | file,
|
151 | input,
|
152 | inputSourceMap,
|
153 | extractComments,
|
154 | minify: minifyFn
|
155 | } = options;
|
156 |
|
157 | if (minifyFn) {
|
158 | return minifyFn({
|
159 | [file]: input
|
160 | }, inputSourceMap);
|
161 | }
|
162 |
|
163 |
|
164 | const terserOptions = buildTerserOptions(options.terserOptions);
|
165 |
|
166 | if (inputSourceMap) {
|
167 | terserOptions.sourceMap = true;
|
168 | }
|
169 |
|
170 | const extractedComments = [];
|
171 |
|
172 | if (extractComments) {
|
173 | terserOptions.output.comments = buildComments(options, terserOptions, extractedComments);
|
174 | }
|
175 |
|
176 | const {
|
177 | error,
|
178 | map,
|
179 | code,
|
180 | warnings
|
181 | } = (0, _terser.minify)({
|
182 | [file]: input
|
183 | }, terserOptions);
|
184 | return {
|
185 | error,
|
186 | map,
|
187 | code,
|
188 | warnings,
|
189 | extractedComments
|
190 | };
|
191 | };
|
192 |
|
193 | var _default = minify;
|
194 | exports.default = _default;
|
195 |
|
196 | }),
|
197 |
|
198 | 359:
|
199 | (function(module, exports, __nccwpck_require__) {
|
200 |
|
201 | module = __nccwpck_require__.nmd(module);
|
202 |
|
203 |
|
204 | var _minify = _interopRequireDefault(__nccwpck_require__(787));
|
205 |
|
206 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
207 |
|
208 | module.exports = (options, callback) => {
|
209 | try {
|
210 |
|
211 |
|
212 |
|
213 | options = new Function('exports', 'require', 'module', '__filename', '__dirname', `'use strict'\nreturn ${options}`)(exports, require, module, __filename, __dirname);
|
214 | callback(null, (0, _minify.default)(options));
|
215 | } catch (errors) {
|
216 | callback(errors);
|
217 | }
|
218 | };
|
219 |
|
220 | }),
|
221 |
|
222 | 775:
|
223 | (function(module) {
|
224 |
|
225 | module.exports = require("next/dist/compiled/terser");;
|
226 |
|
227 | })
|
228 |
|
229 | });
|
230 |
|
231 |
|
232 | var __webpack_module_cache__ = {};
|
233 |
|
234 |
|
235 | function __nccwpck_require__(moduleId) {
|
236 |
|
237 | if(__webpack_module_cache__[moduleId]) {
|
238 | return __webpack_module_cache__[moduleId].exports;
|
239 | }
|
240 |
|
241 | var module = __webpack_module_cache__[moduleId] = {
|
242 | id: moduleId,
|
243 | loaded: false,
|
244 | exports: {}
|
245 | };
|
246 |
|
247 |
|
248 | var threw = true;
|
249 | try {
|
250 | __webpack_modules__[moduleId](module, module.exports, __nccwpck_require__);
|
251 | threw = false;
|
252 | } finally {
|
253 | if(threw) delete __webpack_module_cache__[moduleId];
|
254 | }
|
255 |
|
256 |
|
257 | module.loaded = true;
|
258 |
|
259 |
|
260 | return module.exports;
|
261 | }
|
262 |
|
263 |
|
264 |
|
265 | !function() {
|
266 | __nccwpck_require__.nmd = function(module) {
|
267 | module.paths = [];
|
268 | if (!module.children) module.children = [];
|
269 | return module;
|
270 | };
|
271 | }();
|
272 |
|
273 |
|
274 |
|
275 | __nccwpck_require__.ab = __dirname + "/";
|
276 |
|
277 |
|
278 |
|
279 | return __nccwpck_require__(359);
|
280 | })()
|
281 | ; |
\ | No newline at end of file |