diff --git a/packages/next/build/webpack-config.ts b/packages/next/build/webpack-config.ts index 34cbe9cce37f9..9bb275b6b5572 100644 --- a/packages/next/build/webpack-config.ts +++ b/packages/next/build/webpack-config.ts @@ -156,18 +156,6 @@ export default async function getBaseWebpackConfig( const hasReactRefresh = dev && !isServer && config.experimental.reactRefresh === true - // Inject additional features into webpack HMR runtime - if (hasReactRefresh) { - const injectPath = require.resolve( - 'webpack/lib/HotModuleReplacement.runtime' - ) - const overridePath = require.resolve( - './webpack/lib/HotModuleReplacement.runtime' - ) - require(overridePath) - require.cache[injectPath] = require.cache[overridePath] - } - const distDir = path.join(dir, config.distDir) const defaultLoaders = { babel: { diff --git a/packages/next/build/webpack/lib/HotModuleReplacement.runtime.js b/packages/next/build/webpack/lib/HotModuleReplacement.runtime.js deleted file mode 100644 index 784140bb8a861..0000000000000 --- a/packages/next/build/webpack/lib/HotModuleReplacement.runtime.js +++ /dev/null @@ -1,720 +0,0 @@ -/* - MIT License http://www.opensource.org/licenses/mit-license.php - Author Tobias Koppers @sokra -*/ -// eslint-disable no-unused-vars -var $hash$ = undefined -var $requestTimeout$ = undefined -var installedModules = undefined -var $require$ = undefined -var hotDownloadManifest = undefined -var hotDownloadUpdateChunk = undefined -var hotDisposeChunk = undefined -var modules = undefined -var chunkId = undefined - -module.exports = function() { - var hotApplyOnUpdate = true - // eslint-disable-next-line no-unused-vars - var hotCurrentHash = $hash$ - var hotRequestTimeout = $requestTimeout$ - var hotCurrentModuleData = {} - var hotCurrentChildModule - // eslint-disable-next-line no-unused-vars - var hotCurrentParents = [] - // eslint-disable-next-line no-unused-vars - var hotCurrentParentsTemp = [] - - // eslint-disable-next-line no-unused-vars - function hotCreateRequire(moduleId) { - var me = installedModules[moduleId] - if (!me) return $require$ - var fn = function(request) { - if (me.hot.active) { - if (installedModules[request]) { - if (installedModules[request].parents.indexOf(moduleId) === -1) { - installedModules[request].parents.push(moduleId) - } - } else { - hotCurrentParents = [moduleId] - hotCurrentChildModule = request - } - if (me.children.indexOf(request) === -1) { - me.children.push(request) - } - } else { - console.warn( - '[HMR] unexpected require(' + - request + - ') from disposed module ' + - moduleId - ) - hotCurrentParents = [] - } - return $require$(request) - } - var ObjectFactory = function ObjectFactory(name) { - return { - configurable: true, - enumerable: true, - get: function() { - return $require$[name] - }, - set: function(value) { - $require$[name] = value - }, - } - } - for (var name in $require$) { - if ( - Object.prototype.hasOwnProperty.call($require$, name) && - name !== 'e' && - name !== 't' - ) { - Object.defineProperty(fn, name, ObjectFactory(name)) - } - } - fn.e = function(chunkId) { - if (hotStatus === 'ready') hotSetStatus('prepare') - hotChunksLoading++ - return $require$.e(chunkId).then(finishChunkLoading, function(err) { - finishChunkLoading() - throw err - }) - - function finishChunkLoading() { - hotChunksLoading-- - if (hotStatus === 'prepare') { - if (!hotWaitingFilesMap[chunkId]) { - hotEnsureUpdateChunk(chunkId) - } - if (hotChunksLoading === 0 && hotWaitingFiles === 0) { - hotUpdateDownloaded() - } - } - } - } - fn.t = function(value, mode) { - if (mode & 1) value = fn(value) - return $require$.t(value, mode & ~1) - } - return fn - } - - // eslint-disable-next-line no-unused-vars - function hotCreateModule(moduleId) { - var hot = { - // private stuff - _acceptedDependencies: {}, - _declinedDependencies: {}, - _selfAccepted: false, - _selfDeclined: false, - _selfInvalidated: false, - _disposeHandlers: [], - _main: hotCurrentChildModule !== moduleId, - - // Module API - active: true, - accept: function(dep, callback) { - if (dep === undefined) hot._selfAccepted = true - else if (typeof dep === 'function') hot._selfAccepted = dep - else if (typeof dep === 'object') - for (var i = 0; i < dep.length; i++) - hot._acceptedDependencies[dep[i]] = callback || function() {} - else hot._acceptedDependencies[dep] = callback || function() {} - }, - decline: function(dep) { - if (dep === undefined) hot._selfDeclined = true - else if (typeof dep === 'object') - for (var i = 0; i < dep.length; i++) - hot._declinedDependencies[dep[i]] = true - else hot._declinedDependencies[dep] = true - }, - dispose: function(callback) { - hot._disposeHandlers.push(callback) - }, - addDisposeHandler: function(callback) { - hot._disposeHandlers.push(callback) - }, - removeDisposeHandler: function(callback) { - var idx = hot._disposeHandlers.indexOf(callback) - if (idx >= 0) hot._disposeHandlers.splice(idx, 1) - }, - invalidate: function() { - this._selfInvalidated = true - switch (hotStatus) { - case 'idle': - hotUpdate = {} - hotUpdate[moduleId] = modules[moduleId] - hotSetStatus('ready') - break - case 'ready': - hotApplyInvalidatedModule(moduleId) - break - case 'prepare': - case 'check': - case 'dispose': - case 'apply': - ;(hotQueuedInvalidatedModules = - hotQueuedInvalidatedModules || []).push(moduleId) - break - default: - // ignore requests in error states - break - } - }, - - // Management API - check: hotCheck, - apply: hotApply, - status: function(l) { - if (!l) return hotStatus - hotStatusHandlers.push(l) - }, - addStatusHandler: function(l) { - hotStatusHandlers.push(l) - }, - removeStatusHandler: function(l) { - var idx = hotStatusHandlers.indexOf(l) - if (idx >= 0) hotStatusHandlers.splice(idx, 1) - }, - - //inherit from previous dispose call - data: hotCurrentModuleData[moduleId], - } - hotCurrentChildModule = undefined - return hot - } - - var hotStatusHandlers = [] - var hotStatus = 'idle' - - function hotSetStatus(newStatus) { - hotStatus = newStatus - for (var i = 0; i < hotStatusHandlers.length; i++) - hotStatusHandlers[i].call(null, newStatus) - } - - // while downloading - var hotWaitingFiles = 0 - var hotChunksLoading = 0 - var hotWaitingFilesMap = {} - var hotRequestedFilesMap = {} - var hotAvailableFilesMap = {} - var hotDeferred - - // The update info - var hotUpdate, hotUpdateNewHash, hotQueuedInvalidatedModules - - function toModuleId(id) { - var isNumber = +id + '' === id - return isNumber ? +id : id - } - - function hotCheck(apply) { - if (hotStatus !== 'idle') { - throw new Error('check() is only allowed in idle status') - } - hotApplyOnUpdate = apply - hotSetStatus('check') - return hotDownloadManifest(hotRequestTimeout).then(function(update) { - if (!update) { - hotSetStatus(hotApplyInvalidatedModules() ? 'ready' : 'idle') - return null - } - hotRequestedFilesMap = {} - hotWaitingFilesMap = {} - hotAvailableFilesMap = update.c - hotUpdateNewHash = update.h - - hotSetStatus('prepare') - var promise = new Promise(function(resolve, reject) { - hotDeferred = { - resolve: resolve, - reject: reject, - } - }) - hotUpdate = {} - /*foreachInstalledChunks*/ - // eslint-disable-next-line no-lone-blocks - { - hotEnsureUpdateChunk(chunkId) - } - if ( - hotStatus === 'prepare' && - hotChunksLoading === 0 && - hotWaitingFiles === 0 - ) { - hotUpdateDownloaded() - } - return promise - }) - } - - // eslint-disable-next-line no-unused-vars - function hotAddUpdateChunk(chunkId, moreModules) { - if (!hotAvailableFilesMap[chunkId] || !hotRequestedFilesMap[chunkId]) return - hotRequestedFilesMap[chunkId] = false - for (var moduleId in moreModules) { - if (Object.prototype.hasOwnProperty.call(moreModules, moduleId)) { - hotUpdate[moduleId] = moreModules[moduleId] - } - } - if (--hotWaitingFiles === 0 && hotChunksLoading === 0) { - hotUpdateDownloaded() - } - } - - function hotEnsureUpdateChunk(chunkId) { - if (!hotAvailableFilesMap[chunkId]) { - hotWaitingFilesMap[chunkId] = true - } else { - hotRequestedFilesMap[chunkId] = true - hotWaitingFiles++ - hotDownloadUpdateChunk(chunkId) - } - } - - function hotUpdateDownloaded() { - hotSetStatus('ready') - var deferred = hotDeferred - hotDeferred = null - if (!deferred) return - if (hotApplyOnUpdate) { - // Wrap deferred object in Promise to mark it as a well-handled Promise to - // avoid triggering uncaught exception warning in Chrome. - // See https://bugs.chromium.org/p/chromium/issues/detail?id=465666 - Promise.resolve() - .then(function() { - return hotApply(hotApplyOnUpdate) - }) - .then( - function(result) { - deferred.resolve(result) - }, - function(err) { - deferred.reject(err) - } - ) - } else { - var outdatedModules = [] - for (var id in hotUpdate) { - if (Object.prototype.hasOwnProperty.call(hotUpdate, id)) { - outdatedModules.push(toModuleId(id)) - } - } - deferred.resolve(outdatedModules) - } - } - - function hotApply(options) { - if (hotStatus !== 'ready') - throw new Error('apply() is only allowed in ready status') - options = options || {} - return hotApplyInternal(options) - } - - function hotApplyInternal(options) { - hotApplyInvalidatedModules() - - var cb - var i - var j - var module - var moduleId - - function getAffectedStuff(updateModuleId) { - var outdatedModules = [updateModuleId] - var outdatedDependencies = {} - - var queue = outdatedModules.map(function(id) { - return { - chain: [id], - id: id, - } - }) - while (queue.length > 0) { - var queueItem = queue.pop() - var moduleId = queueItem.id - var chain = queueItem.chain - module = installedModules[moduleId] - if ( - !module || - (module.hot._selfAccepted && !module.hot._selfInvalidated) - ) - continue - if (module.hot._selfDeclined) { - return { - type: 'self-declined', - chain: chain, - moduleId: moduleId, - } - } - if (module.hot._main) { - return { - type: 'unaccepted', - chain: chain, - moduleId: moduleId, - } - } - for (var i = 0; i < module.parents.length; i++) { - var parentId = module.parents[i] - var parent = installedModules[parentId] - if (!parent) continue - if (parent.hot._declinedDependencies[moduleId]) { - return { - type: 'declined', - chain: chain.concat([parentId]), - moduleId: moduleId, - parentId: parentId, - } - } - if (outdatedModules.indexOf(parentId) !== -1) continue - if (parent.hot._acceptedDependencies[moduleId]) { - if (!outdatedDependencies[parentId]) - outdatedDependencies[parentId] = [] - addAllToSet(outdatedDependencies[parentId], [moduleId]) - continue - } - delete outdatedDependencies[parentId] - outdatedModules.push(parentId) - queue.push({ - chain: chain.concat([parentId]), - id: parentId, - }) - } - } - - return { - type: 'accepted', - moduleId: updateModuleId, - outdatedModules: outdatedModules, - outdatedDependencies: outdatedDependencies, - } - } - - function addAllToSet(a, b) { - for (var i = 0; i < b.length; i++) { - var item = b[i] - if (a.indexOf(item) === -1) a.push(item) - } - } - - // at begin all updates modules are outdated - // the "outdated" status can propagate to parents if they don't accept the children - var outdatedDependencies = {} - var outdatedModules = [] - var appliedUpdate = {} - - var warnUnexpectedRequire = function warnUnexpectedRequire() { - console.warn( - '[HMR] unexpected require(' + result.moduleId + ') to disposed module' - ) - } - - for (var id in hotUpdate) { - if (Object.prototype.hasOwnProperty.call(hotUpdate, id)) { - moduleId = toModuleId(id) - /** @type {TODO} */ - var result - if (hotUpdate[id]) { - result = getAffectedStuff(moduleId) - } else { - result = { - type: 'disposed', - moduleId: id, - } - } - /** @type {Error|false} */ - var abortError = false - var doApply = false - var doDispose = false - var chainInfo = '' - if (result.chain) { - chainInfo = '\nUpdate propagation: ' + result.chain.join(' -> ') - } - switch (result.type) { - case 'self-declined': - if (options.onDeclined) options.onDeclined(result) - if (!options.ignoreDeclined) - abortError = new Error( - 'Aborted because of self decline: ' + - result.moduleId + - chainInfo - ) - break - case 'declined': - if (options.onDeclined) options.onDeclined(result) - if (!options.ignoreDeclined) - abortError = new Error( - 'Aborted because of declined dependency: ' + - result.moduleId + - ' in ' + - result.parentId + - chainInfo - ) - break - case 'unaccepted': - if (options.onUnaccepted) options.onUnaccepted(result) - if (!options.ignoreUnaccepted) - abortError = new Error( - 'Aborted because ' + moduleId + ' is not accepted' + chainInfo - ) - break - case 'accepted': - if (options.onAccepted) options.onAccepted(result) - doApply = true - break - case 'disposed': - if (options.onDisposed) options.onDisposed(result) - doDispose = true - break - default: - throw new Error('Unexception type ' + result.type) - } - if (abortError) { - hotSetStatus('abort') - return Promise.reject(abortError) - } - if (doApply) { - appliedUpdate[moduleId] = hotUpdate[moduleId] - addAllToSet(outdatedModules, result.outdatedModules) - for (moduleId in result.outdatedDependencies) { - if ( - Object.prototype.hasOwnProperty.call( - result.outdatedDependencies, - moduleId - ) - ) { - if (!outdatedDependencies[moduleId]) - outdatedDependencies[moduleId] = [] - addAllToSet( - outdatedDependencies[moduleId], - result.outdatedDependencies[moduleId] - ) - } - } - } - if (doDispose) { - addAllToSet(outdatedModules, [result.moduleId]) - appliedUpdate[moduleId] = warnUnexpectedRequire - } - } - } - - // Store self accepted outdated modules to require them later by the module system - var outdatedSelfAcceptedModules = [] - for (i = 0; i < outdatedModules.length; i++) { - moduleId = outdatedModules[i] - if ( - installedModules[moduleId] && - installedModules[moduleId].hot._selfAccepted && - // removed self-accepted modules should not be required - appliedUpdate[moduleId] !== warnUnexpectedRequire && - // when called invalidate self-accepting is not possible - !installedModules[moduleId].hot._selfInvalidated - ) { - outdatedSelfAcceptedModules.push({ - module: moduleId, - parents: installedModules[moduleId].parents.slice(), - errorHandler: installedModules[moduleId].hot._selfAccepted, - }) - } - } - - // Now in "dispose" phase - hotSetStatus('dispose') - Object.keys(hotAvailableFilesMap).forEach(function(chunkId) { - if (hotAvailableFilesMap[chunkId] === false) { - hotDisposeChunk(chunkId) - } - }) - - var idx - var queue = outdatedModules.slice() - while (queue.length > 0) { - moduleId = queue.pop() - module = installedModules[moduleId] - if (!module) continue - - var data = {} - - // Call dispose handlers - var disposeHandlers = module.hot._disposeHandlers - for (j = 0; j < disposeHandlers.length; j++) { - cb = disposeHandlers[j] - cb(data) - } - hotCurrentModuleData[moduleId] = data - - // disable module (this disables requires from this module) - module.hot.active = false - - // remove module from cache - delete installedModules[moduleId] - - // when disposing there is no need to call dispose handler - delete outdatedDependencies[moduleId] - - // remove "parents" references from all children - for (j = 0; j < module.children.length; j++) { - var child = installedModules[module.children[j]] - if (!child) continue - idx = child.parents.indexOf(moduleId) - if (idx >= 0) { - child.parents.splice(idx, 1) - } - } - } - - // remove outdated dependency from module children - var dependency - var moduleOutdatedDependencies - for (moduleId in outdatedDependencies) { - if ( - Object.prototype.hasOwnProperty.call(outdatedDependencies, moduleId) - ) { - module = installedModules[moduleId] - if (module) { - moduleOutdatedDependencies = outdatedDependencies[moduleId] - for (j = 0; j < moduleOutdatedDependencies.length; j++) { - dependency = moduleOutdatedDependencies[j] - idx = module.children.indexOf(dependency) - if (idx >= 0) module.children.splice(idx, 1) - } - } - } - } - - // Now in "apply" phase - hotSetStatus('apply') - - if (hotUpdateNewHash !== undefined) { - hotCurrentHash = hotUpdateNewHash - hotUpdateNewHash = undefined - } - hotUpdate = undefined - - // insert new code - for (moduleId in appliedUpdate) { - if (Object.prototype.hasOwnProperty.call(appliedUpdate, moduleId)) { - modules[moduleId] = appliedUpdate[moduleId] - } - } - - // call accept handlers - var error = null - for (moduleId in outdatedDependencies) { - if ( - Object.prototype.hasOwnProperty.call(outdatedDependencies, moduleId) - ) { - module = installedModules[moduleId] - if (module) { - moduleOutdatedDependencies = outdatedDependencies[moduleId] - var callbacks = [] - for (i = 0; i < moduleOutdatedDependencies.length; i++) { - dependency = moduleOutdatedDependencies[i] - cb = module.hot._acceptedDependencies[dependency] - if (cb) { - if (callbacks.indexOf(cb) !== -1) continue - callbacks.push(cb) - } - } - for (i = 0; i < callbacks.length; i++) { - cb = callbacks[i] - try { - cb(moduleOutdatedDependencies) - } catch (err) { - if (options.onErrored) { - options.onErrored({ - type: 'accept-errored', - moduleId: moduleId, - dependencyId: moduleOutdatedDependencies[i], - error: err, - }) - } - if (!options.ignoreErrored) { - if (!error) error = err - } - } - } - } - } - } - - // Load self accepted modules - for (i = 0; i < outdatedSelfAcceptedModules.length; i++) { - var item = outdatedSelfAcceptedModules[i] - moduleId = item.module - hotCurrentParents = item.parents - hotCurrentChildModule = moduleId - try { - $require$(moduleId) - } catch (err) { - if (typeof item.errorHandler === 'function') { - try { - item.errorHandler(err) - } catch (err2) { - if (options.onErrored) { - options.onErrored({ - type: 'self-accept-error-handler-errored', - moduleId: moduleId, - error: err2, - originalError: err, - }) - } - if (!options.ignoreErrored) { - if (!error) error = err2 - } - if (!error) error = err - } - } else { - if (options.onErrored) { - options.onErrored({ - type: 'self-accept-errored', - moduleId: moduleId, - error: err, - }) - } - if (!options.ignoreErrored) { - if (!error) error = err - } - } - } - } - - // handle errors in accept handlers and self accepted module load - if (error) { - hotSetStatus('fail') - return Promise.reject(error) - } - - if (hotQueuedInvalidatedModules) { - return hotApplyInternal(options).then(function(list) { - outdatedModules.forEach(function(moduleId) { - if (list.indexOf(moduleId) < 0) list.push(moduleId) - }) - return list - }) - } - - hotSetStatus('idle') - return new Promise(function(resolve) { - resolve(outdatedModules) - }) - } - - function hotApplyInvalidatedModules() { - if (hotQueuedInvalidatedModules) { - if (!hotUpdate) hotUpdate = {} - hotQueuedInvalidatedModules.forEach(hotApplyInvalidatedModule) - hotQueuedInvalidatedModules = undefined - return true - } - } - - function hotApplyInvalidatedModule(moduleId) { - if (!Object.prototype.hasOwnProperty.call(hotUpdate, moduleId)) - hotUpdate[moduleId] = modules[moduleId] - } -} diff --git a/packages/next/compiled/terser-webpack-plugin/cjs.js b/packages/next/compiled/terser-webpack-plugin/cjs.js index 580e315429280..dc88257fb9ed8 100644 --- a/packages/next/compiled/terser-webpack-plugin/cjs.js +++ b/packages/next/compiled/terser-webpack-plugin/cjs.js @@ -1 +1 @@ -module.exports=function(e,t){"use strict";var r={};function __webpack_require__(t){if(r[t]){return r[t].exports}var n=r[t]={i:t,l:false,exports:{}};e[t].call(n.exports,n,n.exports,__webpack_require__);n.l=true;return n.exports}__webpack_require__.ab=__dirname+"/";function startup(){return __webpack_require__(596)}t(__webpack_require__);return startup()}({67:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:true});t.default=void 0;var n=_interopRequireDefault(r(622));var i=r(241);var s=r(745);var o=_interopRequireDefault(r(432));var a=r(78);var u=_interopRequireDefault(r(134));var c=_interopRequireDefault(r(946));var l=_interopRequireDefault(r(403));var f=_interopRequireDefault(r(916));var p=_interopRequireDefault(r(838));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}const d=/\[.+:([0-9]+),([0-9]+)\]/;class TerserPlugin{constructor(e={}){(0,u.default)(f.default,e,{name:"Terser Plugin",baseDataPath:"options"});const{minify:t,terserOptions:r={},test:n=/\.m?js(\?.*)?$/i,chunkFilter:i=(()=>true),warningsFilter:s=(()=>true),extractComments:o=true,sourceMap:a,cache:c=true,cacheKeys:l=(e=>e),parallel:p=true,include:d,exclude:m}=e;this.options={test:n,chunkFilter:i,warningsFilter:s,extractComments:o,sourceMap:a,cache:c,cacheKeys:l,parallel:p,include:d,exclude:m,minify:t,terserOptions:r}}static isSourceMap(e){return Boolean(e&&e.version&&e.sources&&Array.isArray(e.sources)&&typeof e.mappings==="string")}static buildSourceMap(e){if(!e||!TerserPlugin.isSourceMap(e)){return null}return new i.SourceMapConsumer(e)}static buildError(e,t,r,n){if(e.line){const i=r&&r.originalPositionFor({line:e.line,column:e.col});if(i&&i.source&&n){return new Error(`${t} from Terser\n${e.message} [${n.shorten(i.source)}:${i.line},${i.column}][${t}:${e.line},${e.col}]${e.stack?`\n${e.stack.split("\n").slice(1).join("\n")}`:""}`)}return new Error(`${t} from Terser\n${e.message} [${t}:${e.line},${e.col}]${e.stack?`\n${e.stack.split("\n").slice(1).join("\n")}`:""}`)}if(e.stack){return new Error(`${t} from Terser\n${e.stack}`)}return new Error(`${t} from Terser\n${e.message}`)}static buildWarning(e,t,r,n,i){let s=e;let o="";let a=null;if(r){const i=d.exec(e);if(i){const e=+i[1];const u=+i[2];const c=r.originalPositionFor({line:e,column:u});if(c&&c.source&&c.source!==t&&n){({source:a}=c);s=`${s.replace(d,"")}`;o=`[${n.shorten(c.source)}:${c.line},${c.column}]`}}}if(i&&!i(e,a,t)){return null}return`Terser Plugin: ${s}${o}`}static removeQueryString(e){let t=e;const r=t.indexOf("?");if(r>=0){t=t.substr(0,r)}return t}static hasAsset(e,t){const r=Object.keys(t).map(e=>TerserPlugin.removeQueryString(e));return r.includes(TerserPlugin.removeQueryString(e))}static isWebpack4(){return a.version[0]==="4"}*taskGenerator(e,t,i,u){let c;const f=t.assets[u];try{let p;if(this.options.sourceMap&&f.sourceAndMap){const{source:e,map:r}=f.sourceAndMap();p=e;if(TerserPlugin.isSourceMap(r)){c=r}else{c=r;t.warnings.push(new Error(`${u} contains invalid source map`))}}else{p=f.source();c=null}let d=false;if(this.options.extractComments){d=this.options.extractComments.filename||"[file].LICENSE.txt[query]";if(TerserPlugin.isWebpack4()){if(typeof d==="function"){d=d.bind(null,u)}}let e="";let r=u;const n=r.indexOf("?");if(n>=0){e=r.substr(n);r=r.substr(0,n)}const i=r.lastIndexOf("/");const s=i===-1?r:r.substr(i+1);const o={filename:r,basename:s,query:e};d=t.getPath(d,o)}if(d&&TerserPlugin.hasAsset(d,t.assets)){t.warnings.push(new Error(`The comment file "${TerserPlugin.removeQueryString(d)}" conflicts with an existing asset, this may lead to code corruption, please use a different name`))}const m=r=>{let{code:a}=r;const{error:l,map:f,warnings:m}=r;const{extractedComments:h}=r;let g=null;if(l||m&&m.length>0){g=TerserPlugin.buildSourceMap(c)}if(l){t.errors.push(TerserPlugin.buildError(l,u,g,new o.default(e.context)));return}const b=d&&h&&h.length>0;const y=b&&this.options.extractComments.banner!==false;let v;let _;if(b&&y&&a.startsWith("#!")){const e=a.indexOf("\n");_=a.substring(0,e);a=a.substring(e+1)}if(f){v=new s.SourceMapSource(a,u,f,p,c,true)}else{v=new s.RawSource(a)}if(b){if(!i[d]){i[d]=[]}i[d]=i[d].concat(h);if(y){let e=this.options.extractComments.banner||`For license information please see ${n.default.relative(n.default.dirname(u),d).replace(/\\/g,"/")}`;if(typeof e==="function"){e=e(d)}if(e){v=new s.ConcatSource(_?`${_}\n`:"",`/*! ${e} */\n`,v)}}}t.assets[u]=v;if(m&&m.length>0){m.forEach(r=>{const n=TerserPlugin.buildWarning(r,u,g,new o.default(e.context),this.options.warningsFilter);if(n){t.warnings.push(n)}})}};const h={asset:f,file:u,input:p,inputSourceMap:c,commentsFilename:d,extractComments:this.options.extractComments,terserOptions:this.options.terserOptions,minify:this.options.minify,callback:m};if(TerserPlugin.isWebpack4()){const{outputOptions:{hashSalt:e,hashDigest:n,hashDigestLength:i,hashFunction:s}}=t;const o=a.util.createHash(s);if(e){o.update(e)}o.update(p);const c=o.digest(n);if(this.options.cache){const e={terser:l.default.version,"terser-webpack-plugin":r(379).version,"terser-webpack-plugin-options":this.options,nodeVersion:process.version,filename:u,contentHash:c.substr(0,i)};h.cacheKeys=this.options.cacheKeys(e,u)}}else{h.cacheKeys={terser:l.default.version,"terser-webpack-plugin":r(379).version,"terser-webpack-plugin-options":this.options}}yield h}catch(r){t.errors.push(TerserPlugin.buildError(r,u,TerserPlugin.buildSourceMap(c),new o.default(e.context)))}}apply(e){const{devtool:t,output:n,plugins:i}=e.options;this.options.sourceMap=typeof this.options.sourceMap==="undefined"?t&&!t.includes("eval")&&!t.includes("cheap")&&(t.includes("source-map")||t.includes("sourcemap"))||i&&i.some(e=>e instanceof a.SourceMapDevToolPlugin&&e.options&&e.options.columns):Boolean(this.options.sourceMap);if(typeof this.options.terserOptions.module==="undefined"&&typeof n.module!=="undefined"){this.options.terserOptions.module=n.module}if(typeof this.options.terserOptions.ecma==="undefined"&&typeof n.ecmaVersion!=="undefined"){this.options.terserOptions.ecma=n.ecmaVersion}const o=async(t,n)=>{const i=a.ModuleFilenameHelpers.matchObject.bind(undefined,this.options);const o=[].concat(Array.from(t.additionalChunkAssets||[])).concat(Array.from(n).filter(e=>this.options.chunkFilter&&this.options.chunkFilter(e)).reduce((e,t)=>e.concat(Array.from(t.files||[])),[])).filter(e=>i(e));if(o.length===0){return Promise.resolve()}const u=TerserPlugin.isWebpack4()?r(314).default:r(428).default;const c={};const l=this.taskGenerator.bind(this,e,t,c);const f=new p.default({taskGenerator:l,files:o,cache:new u(e,t,this.options),parallel:this.options.parallel});await f.run();await f.exit();Object.keys(c).forEach(e=>{const r=new Set([...c[e].sort()]);t.assets[e]=new s.RawSource(`${Array.from(r).join("\n\n")}\n`)});return Promise.resolve()};const u={name:this.constructor.name};e.hooks.compilation.tap(u,e=>{if(this.options.sourceMap){e.hooks.buildModule.tap(u,e=>{e.useSourceMap=true})}if(!TerserPlugin.isWebpack4()){const t=a.javascript.JavascriptModulesPlugin.getCompilationHooks(e);const r=(0,c.default)({terser:l.default.version,terserOptions:this.options.terserOptions});t.chunkHash.tap(u,(e,t)=>{t.update("TerserPlugin");t.update(r)})}else{const{mainTemplate:t,chunkTemplate:r}=e;const n=(0,c.default)({terser:l.default.version,terserOptions:this.options.terserOptions});for(const e of[t,r]){e.hooks.hashForChunk.tap(u,e=>{e.update("TerserPlugin");e.update(n)})}}e.hooks.optimizeChunkAssets.tapPromise(u,o.bind(this,e))})}}var m=TerserPlugin;t.default=m},78:function(e){e.exports=require("webpack")},87:function(e){e.exports=require("os")},134:function(e){e.exports=require("schema-utils")},240:function(e){e.exports=require("find-cache-dir")},241:function(e){e.exports=require("next/dist/compiled/source-map")},314:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:true});t.default=void 0;var n=_interopRequireDefault(r(87));var i=_interopRequireDefault(r(635));var s=_interopRequireDefault(r(240));var o=_interopRequireDefault(r(946));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}class Webpack4Cache{constructor(e,t,r){this.options=r;this.cacheDir=r.cache===true?Webpack4Cache.getCacheDirectory():r.cache}static getCacheDirectory(){return(0,s.default)({name:"terser-webpack-plugin"})||n.default.tmpdir()}isEnabled(){return!!this.cacheDir}get(e){e.cacheIdent=e.cacheIdent||(0,o.default)(e.cacheKeys);return i.default.get(this.cacheDir,e.cacheIdent).then(({data:e})=>JSON.parse(e))}store(e,t){return i.default.put(this.cacheDir,e.cacheIdent,JSON.stringify(t))}}t.default=Webpack4Cache},379:function(e){e.exports={name:"terser-webpack-plugin",version:"2.3.5",description:"Terser plugin for webpack",license:"MIT",author:"webpack Contrib Team",main:"cjs.js",engines:{node:">= 8.9.0"},peerDependencies:{webpack:"^4.0.0 || ^5.0.0"},dependencies:{cacache:"^13.0.1","find-cache-dir":"^3.2.0","jest-worker":"^25.1.0","p-limit":"^2.2.2","schema-utils":"^2.6.4","serialize-javascript":"^2.1.2","source-map":"^0.6.1",terser:"^4.4.3","webpack-sources":"^1.4.3"}}},403:function(e){e.exports={name:"terser",description:"JavaScript parser, mangler/compressor and beautifier toolkit for ES6+",homepage:"https://terser.org",author:"Mihai Bazon (http://lisperator.net/)",license:"BSD-2-Clause",version:"4.6.11",engines:{node:">=6.0.0"},maintainers:["Fábio Santos "],repository:"https://github.com/terser/terser",main:"dist/bundle.min.js",types:"tools/terser.d.ts",bin:{terser:"bin/terser"},files:["bin","dist","tools","LICENSE","README.md","CHANGELOG.md","PATRONS.md"],dependencies:{commander:"^2.20.0","source-map":"~0.6.1","source-map-support":"~0.5.12"},devDependencies:{acorn:"^7.1.1",astring:"^1.4.1",eslint:"^6.3.0",eslump:"^2.0.0",mocha:"^7.1.0",mochallel:"^2.0.0","pre-commit":"^1.2.2",rimraf:"^3.0.0",rollup:"2.0.6","rollup-plugin-terser":"5.3.0",semver:"^7.1.3"},scripts:{test:"npm run build -- --configTest && node test/run-tests.js","test:compress":"npm run build -- --configTest && node test/compress.js","test:mocha":"npm run build -- --configTest && node test/mocha.js",lint:"eslint lib","lint-fix":"eslint --fix lib",build:"rimraf dist/* && rollup --config --silent",prepare:"npm run build",postversion:"echo 'Remember to update the changelog!'"},keywords:["uglify","terser","uglify-es","uglify-js","minify","minifier","javascript","ecmascript","es5","es6","es7","es8","es2015","es2016","es2017","async","await"],eslintConfig:{parserOptions:{sourceType:"module"},env:{es6:true},globals:{describe:false,it:false,require:false,global:false,process:false},rules:{"brace-style":["error","1tbs",{allowSingleLine:true}],quotes:["error","double","avoid-escape"],"no-debugger":"error","no-undef":"error","no-unused-vars":["error",{varsIgnorePattern:"^_$"}],"no-tabs":"error",semi:["error","always"],"no-extra-semi":"error","no-irregular-whitespace":"error","space-before-blocks":["error","always"]}},"pre-commit":["lint-fix","test"]}},428:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:true});t.default=void 0;var n=_interopRequireDefault(r(575));var i=_interopRequireDefault(r(946));var s=r(78);function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}class Cache{constructor(e,t,r){this.compiler=e;this.compilation=t;this.options=r}isEnabled(){return!!this.compilation.cache}createCacheIdent(e){const{outputOptions:{hashSalt:t,hashDigest:r,hashDigestLength:n,hashFunction:o}}=this.compilation;const a=s.util.createHash(o);if(t){a.update(t)}a.update((0,i.default)(e.cacheKeys));const u=a.digest(r);const c=u.substr(0,n);return`${this.compilation.compilerPath}/TerserWebpackPlugin/${c}/${e.file}`}get(e){e.cacheIdent=e.cacheIdent||this.createCacheIdent(e);e.cacheETag=e.cacheETag||(0,n.default)(e.asset);return new Promise((t,r)=>{this.compilation.cache.get(e.cacheIdent,e.cacheETag,(e,n)=>{if(e){r(e)}else if(n){t(n)}else{r()}})})}store(e,t){return new Promise((r,n)=>{this.compilation.cache.store(e.cacheIdent,e.cacheETag,t,e=>{if(e){n(e)}else{r(t)}})})}}t.default=Cache},429:function(e){"use strict";const t=(e,...t)=>new Promise(r=>{r(e(...t))});e.exports=t;e.exports.default=t},432:function(e){e.exports=require("webpack/lib/RequestShortener")},466:function(e,t,r){"use strict";e=r.nmd(e);const{minify:n}=r(775);const i=({ecma:e,warnings:t,parse:r={},compress:n={},mangle:i,module:s,output:o,toplevel:a,nameCache:u,ie8:c,keep_classnames:l,keep_fnames:f,safari10:p}={})=>({ecma:e,warnings:t,parse:{...r},compress:typeof n==="boolean"?n:{...n},mangle:i==null?true:typeof i==="boolean"?i:{...i},output:{beautify:false,...o},module:s,sourceMap:null,toplevel:a,nameCache:u,ie8:c,keep_classnames:l,keep_fnames:f,safari10:p});function isObject(e){const t=typeof e;return e!=null&&(t==="object"||t==="function")}const s=(e,t,r)=>{const n={};const i=t.output.comments;const{extractComments:s}=e;n.preserve=typeof i!=="undefined"?i:false;if(typeof s==="boolean"&&s){n.extract="some"}else if(typeof s==="string"||s instanceof RegExp){n.extract=s}else if(typeof s==="function"){n.extract=s}else if(isObject(s)){n.extract=typeof s.condition==="boolean"&&s.condition?"some":typeof s.condition!=="undefined"?s.condition:"some"}else{n.preserve=typeof i!=="undefined"?i:"some";n.extract=false}["preserve","extract"].forEach(e=>{let t;let r;switch(typeof n[e]){case"boolean":n[e]=n[e]?()=>true:()=>false;break;case"function":break;case"string":if(n[e]==="all"){n[e]=(()=>true);break}if(n[e]==="some"){n[e]=((e,t)=>{return t.type==="comment2"&&/@preserve|@lic|@cc_on|^\**!/i.test(t.value)});break}t=n[e];n[e]=((e,r)=>{return new RegExp(t).test(r.value)});break;default:r=n[e];n[e]=((e,t)=>r.test(t.value))}});return(e,t)=>{if(n.extract(e,t)){const e=t.type==="comment2"?`/*${t.value}*/`:`//${t.value}`;if(!r.includes(e)){r.push(e)}}return n.preserve(e,t)}};const o=e=>{const{file:t,input:r,inputSourceMap:o,minify:a}=e;if(a){return a({[t]:r},o)}const u=i(e.terserOptions);if(o){u.sourceMap={asObject:true}}const c=[];u.output.comments=s(e,u,c);const{error:l,map:f,code:p,warnings:d}=n({[t]:r},u);return{error:l,map:f,code:p,warnings:d,extractedComments:c}};function transform(r){r=new Function("exports","require","module","__filename","__dirname",`'use strict'\nreturn ${r}`)(t,require,e,__filename,__dirname);const n=o(r);if(n.error){throw n.error}else{return n}}e.exports.minify=o;e.exports.transform=transform},499:function(e,t,r){"use strict";const n=r(429);const i=e=>{if(!((Number.isInteger(e)||e===Infinity)&&e>0)){return Promise.reject(new TypeError("Expected `concurrency` to be a number from 1 and up"))}const t=[];let r=0;const i=()=>{r--;if(t.length>0){t.shift()()}};const s=(e,t,...s)=>{r++;const o=n(e,...s);t(o);o.then(i,i)};const o=(n,i,...o)=>{if(rnew Promise(r=>o(e,r,...t));Object.defineProperties(a,{activeCount:{get:()=>r},pendingCount:{get:()=>t.length},clearQueue:{value:()=>{t.length=0}}});return a};e.exports=i;e.exports.default=i},575:function(e){e.exports=require("webpack/lib/cache/getLazyHashedEtag")},596:function(e,t,r){"use strict";const n=r(67);e.exports=n.default},622:function(e){e.exports=require("path")},635:function(e){e.exports=require("cacache")},733:function(e){e.exports=require("jest-worker")},745:function(e){e.exports=require("webpack-sources")},775:function(e){e.exports=require("next/dist/compiled/terser")},838:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:true});t.default=void 0;var n=_interopRequireDefault(r(87));var i=_interopRequireDefault(r(499));var s=_interopRequireDefault(r(733));var o=_interopRequireDefault(r(946));var a=r(466);function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}const u=r.ab+"worker.js";class TaskRunner{constructor(e={}){this.taskGenerator=e.taskGenerator;this.files=e.files;this.cache=e.cache;this.availableNumberOfCores=TaskRunner.getAvailableNumberOfCores(e.parallel)}static getAvailableNumberOfCores(e){const t=n.default.cpus()||{length:1};return e===true?t.length-1:Math.min(Number(e)||0,t.length-1)}async runTask(e){if(this.worker){return this.worker.transform((0,o.default)(e))}return(0,a.minify)(e)}async run(){const{availableNumberOfCores:e,cache:t,files:n,taskGenerator:o}=this;let a=Infinity;if(e>0){const t=Math.min(n.length,e);a=t;this.worker=new s.default(r.ab+"worker.js",{numWorkers:t});const i=this.worker.getStdout();if(i){i.on("data",e=>{return process.stdout.write(e)})}const o=this.worker.getStderr();if(o){o.on("data",e=>{return process.stderr.write(e)})}}const u=(0,i.default)(a);const c=[];for(const e of n){const r=async e=>{let r;try{r=await this.runTask(e)}catch(e){r={error:e}}if(t.isEnabled()&&!r.error){r=await t.store(e,r).then(()=>r,()=>r)}e.callback(r);return r};c.push(u(()=>{const n=o(e).next().value;if(!n){return Promise.resolve()}if(t.isEnabled()){return t.get(n).then(e=>n.callback(e),()=>r(n))}return r(n)}))}return Promise.all(c)}async exit(){if(!this.worker){return Promise.resolve()}return this.worker.end()}}t.default=TaskRunner},916:function(e){e.exports={additionalProperties:false,definitions:{"file-conditions":{anyOf:[{instanceof:"RegExp"},{type:"string"}]}},properties:{test:{anyOf:[{$ref:"#/definitions/file-conditions"},{items:{anyOf:[{$ref:"#/definitions/file-conditions"}]},type:"array"}]},include:{anyOf:[{$ref:"#/definitions/file-conditions"},{items:{anyOf:[{$ref:"#/definitions/file-conditions"}]},type:"array"}]},exclude:{anyOf:[{$ref:"#/definitions/file-conditions"},{items:{anyOf:[{$ref:"#/definitions/file-conditions"}]},type:"array"}]},chunkFilter:{instanceof:"Function"},cache:{anyOf:[{type:"boolean"},{type:"string"}]},cacheKeys:{instanceof:"Function"},parallel:{anyOf:[{type:"boolean"},{type:"integer"}]},sourceMap:{type:"boolean"},minify:{instanceof:"Function"},terserOptions:{additionalProperties:true,type:"object"},extractComments:{anyOf:[{type:"boolean"},{type:"string"},{instanceof:"RegExp"},{instanceof:"Function"},{additionalProperties:false,properties:{condition:{anyOf:[{type:"boolean"},{type:"string"},{instanceof:"RegExp"},{instanceof:"Function"}]},filename:{anyOf:[{type:"string"},{instanceof:"Function"}]},banner:{anyOf:[{type:"boolean"},{type:"string"},{instanceof:"Function"}]}},type:"object"}]},warningsFilter:{instanceof:"Function"}},type:"object"}},946:function(e){"use strict";var t=Math.floor(Math.random()*1099511627776).toString(16);var r=new RegExp('"@__(F|R|D|M|S|U)-'+t+'-(\\d+)__@"',"g");var n=/\{\s*\[native code\]\s*\}/g;var i=/function.*?\(/;var s=/.*?=>.*?/;var o=/[<>\/\u2028\u2029]/g;var a=["*","async"];var u={"<":"\\u003C",">":"\\u003E","/":"\\u002F","\u2028":"\\u2028","\u2029":"\\u2029"};function escapeUnsafeChars(e){return u[e]}function deleteFunctions(e){var t=[];for(var r in e){if(typeof e[r]==="function"){t.push(r)}}for(var n=0;n0});var u=o.filter(function(e){return a.indexOf(e)===-1});if(u.length>0){return(o.indexOf("async")>-1?"async ":"")+"function"+(o.join("").indexOf("*")>-1?"*":"")+t.substr(r)}return t}if(u.ignoreFunction&&typeof e==="function"){e=undefined}if(e===undefined){return String(e)}var h;if(u.isJSON&&!u.space){h=JSON.stringify(e)}else{h=JSON.stringify(e,u.isJSON?null:replacer,u.space)}if(typeof h!=="string"){return String(h)}if(u.unsafe!==true){h=h.replace(o,escapeUnsafeChars)}if(c.length===0&&l.length===0&&f.length===0&&p.length===0&&d.length===0&&m.length===0){return h}return h.replace(r,function(e,t,r){if(t==="D"){return'new Date("'+f[r].toISOString()+'")'}if(t==="R"){return"new RegExp("+serialize(l[r].source)+', "'+l[r].flags+'")'}if(t==="M"){return"new Map("+serialize(Array.from(p[r].entries()),u)+")"}if(t==="S"){return"new Set("+serialize(Array.from(d[r].values()),u)+")"}if(t==="U"){return"undefined"}var n=c[r];return serializeFunc(n)})}}},function(e){"use strict";!function(){e.nmd=function(e){e.paths=[];if(!e.children)e.children=[];Object.defineProperty(e,"loaded",{enumerable:true,get:function(){return e.l}});Object.defineProperty(e,"id",{enumerable:true,get:function(){return e.i}});return e}}()}); \ No newline at end of file +module.exports=function(e,t){"use strict";var r={};function __webpack_require__(t){if(r[t]){return r[t].exports}var n=r[t]={i:t,l:false,exports:{}};e[t].call(n.exports,n,n.exports,__webpack_require__);n.l=true;return n.exports}__webpack_require__.ab=__dirname+"/";function startup(){return __webpack_require__(392)}t(__webpack_require__);return startup()}({78:function(e){e.exports=require("webpack")},87:function(e){e.exports=require("os")},134:function(e){e.exports=require("schema-utils")},135:function(e){e.exports={name:"terser-webpack-plugin",version:"2.3.5",description:"Terser plugin for webpack",license:"MIT",author:"webpack Contrib Team",main:"cjs.js",engines:{node:">= 8.9.0"},peerDependencies:{webpack:"^4.0.0 || ^5.0.0"},dependencies:{cacache:"^13.0.1","find-cache-dir":"^3.2.0","jest-worker":"^25.1.0","p-limit":"^2.2.2","schema-utils":"^2.6.4","serialize-javascript":"^2.1.2","source-map":"^0.6.1",terser:"^4.4.3","webpack-sources":"^1.4.3"}}},203:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:true});t.default=void 0;var n=_interopRequireDefault(r(87));var i=_interopRequireDefault(r(635));var s=_interopRequireDefault(r(240));var o=_interopRequireDefault(r(946));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}class Webpack4Cache{constructor(e,t,r){this.options=r;this.cacheDir=r.cache===true?Webpack4Cache.getCacheDirectory():r.cache}static getCacheDirectory(){return(0,s.default)({name:"terser-webpack-plugin"})||n.default.tmpdir()}isEnabled(){return!!this.cacheDir}get(e){e.cacheIdent=e.cacheIdent||(0,o.default)(e.cacheKeys);return i.default.get(this.cacheDir,e.cacheIdent).then(({data:e})=>JSON.parse(e))}store(e,t){return i.default.put(this.cacheDir,e.cacheIdent,JSON.stringify(t))}}t.default=Webpack4Cache},240:function(e){e.exports=require("find-cache-dir")},241:function(e){e.exports=require("next/dist/compiled/source-map")},341:function(e,t,r){"use strict";const n=r(429);const i=e=>{if(!((Number.isInteger(e)||e===Infinity)&&e>0)){return Promise.reject(new TypeError("Expected `concurrency` to be a number from 1 and up"))}const t=[];let r=0;const i=()=>{r--;if(t.length>0){t.shift()()}};const s=(e,t,...s)=>{r++;const o=n(e,...s);t(o);o.then(i,i)};const o=(n,i,...o)=>{if(rnew Promise(r=>o(e,r,...t));Object.defineProperties(a,{activeCount:{get:()=>r},pendingCount:{get:()=>t.length},clearQueue:{value:()=>{t.length=0}}});return a};e.exports=i;e.exports.default=i},392:function(e,t,r){"use strict";const n=r(407);e.exports=n.default},403:function(e){e.exports={name:"terser",description:"JavaScript parser, mangler/compressor and beautifier toolkit for ES6+",homepage:"https://terser.org",author:"Mihai Bazon (http://lisperator.net/)",license:"BSD-2-Clause",version:"4.6.11",engines:{node:">=6.0.0"},maintainers:["Fábio Santos "],repository:"https://github.com/terser/terser",main:"dist/bundle.min.js",types:"tools/terser.d.ts",bin:{terser:"bin/terser"},files:["bin","dist","tools","LICENSE","README.md","CHANGELOG.md","PATRONS.md"],dependencies:{commander:"^2.20.0","source-map":"~0.6.1","source-map-support":"~0.5.12"},devDependencies:{acorn:"^7.1.1",astring:"^1.4.1",eslint:"^6.3.0",eslump:"^2.0.0",mocha:"^7.1.0",mochallel:"^2.0.0","pre-commit":"^1.2.2",rimraf:"^3.0.0",rollup:"2.0.6","rollup-plugin-terser":"5.3.0",semver:"^7.1.3"},scripts:{test:"npm run build -- --configTest && node test/run-tests.js","test:compress":"npm run build -- --configTest && node test/compress.js","test:mocha":"npm run build -- --configTest && node test/mocha.js",lint:"eslint lib","lint-fix":"eslint --fix lib",build:"rimraf dist/* && rollup --config --silent",prepare:"npm run build",postversion:"echo 'Remember to update the changelog!'"},keywords:["uglify","terser","uglify-es","uglify-js","minify","minifier","javascript","ecmascript","es5","es6","es7","es8","es2015","es2016","es2017","async","await"],eslintConfig:{parserOptions:{sourceType:"module"},env:{es6:true},globals:{describe:false,it:false,require:false,global:false,process:false},rules:{"brace-style":["error","1tbs",{allowSingleLine:true}],quotes:["error","double","avoid-escape"],"no-debugger":"error","no-undef":"error","no-unused-vars":["error",{varsIgnorePattern:"^_$"}],"no-tabs":"error",semi:["error","always"],"no-extra-semi":"error","no-irregular-whitespace":"error","space-before-blocks":["error","always"]}},"pre-commit":["lint-fix","test"]}},407:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:true});t.default=void 0;var n=_interopRequireDefault(r(622));var i=r(241);var s=r(745);var o=_interopRequireDefault(r(432));var a=r(78);var u=_interopRequireDefault(r(134));var c=_interopRequireDefault(r(946));var l=_interopRequireDefault(r(403));var f=_interopRequireDefault(r(670));var p=_interopRequireDefault(r(828));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}const d=/\[.+:([0-9]+),([0-9]+)\]/;class TerserPlugin{constructor(e={}){(0,u.default)(f.default,e,{name:"Terser Plugin",baseDataPath:"options"});const{minify:t,terserOptions:r={},test:n=/\.m?js(\?.*)?$/i,chunkFilter:i=(()=>true),warningsFilter:s=(()=>true),extractComments:o=true,sourceMap:a,cache:c=true,cacheKeys:l=(e=>e),parallel:p=true,include:d,exclude:m}=e;this.options={test:n,chunkFilter:i,warningsFilter:s,extractComments:o,sourceMap:a,cache:c,cacheKeys:l,parallel:p,include:d,exclude:m,minify:t,terserOptions:r}}static isSourceMap(e){return Boolean(e&&e.version&&e.sources&&Array.isArray(e.sources)&&typeof e.mappings==="string")}static buildSourceMap(e){if(!e||!TerserPlugin.isSourceMap(e)){return null}return new i.SourceMapConsumer(e)}static buildError(e,t,r,n){if(e.line){const i=r&&r.originalPositionFor({line:e.line,column:e.col});if(i&&i.source&&n){return new Error(`${t} from Terser\n${e.message} [${n.shorten(i.source)}:${i.line},${i.column}][${t}:${e.line},${e.col}]${e.stack?`\n${e.stack.split("\n").slice(1).join("\n")}`:""}`)}return new Error(`${t} from Terser\n${e.message} [${t}:${e.line},${e.col}]${e.stack?`\n${e.stack.split("\n").slice(1).join("\n")}`:""}`)}if(e.stack){return new Error(`${t} from Terser\n${e.stack}`)}return new Error(`${t} from Terser\n${e.message}`)}static buildWarning(e,t,r,n,i){let s=e;let o="";let a=null;if(r){const i=d.exec(e);if(i){const e=+i[1];const u=+i[2];const c=r.originalPositionFor({line:e,column:u});if(c&&c.source&&c.source!==t&&n){({source:a}=c);s=`${s.replace(d,"")}`;o=`[${n.shorten(c.source)}:${c.line},${c.column}]`}}}if(i&&!i(e,a,t)){return null}return`Terser Plugin: ${s}${o}`}static removeQueryString(e){let t=e;const r=t.indexOf("?");if(r>=0){t=t.substr(0,r)}return t}static hasAsset(e,t){const r=Object.keys(t).map(e=>TerserPlugin.removeQueryString(e));return r.includes(TerserPlugin.removeQueryString(e))}static isWebpack4(){return a.version[0]==="4"}*taskGenerator(e,t,i,u){let c;const f=t.assets[u];try{let p;if(this.options.sourceMap&&f.sourceAndMap){const{source:e,map:r}=f.sourceAndMap();p=e;if(TerserPlugin.isSourceMap(r)){c=r}else{c=r;t.warnings.push(new Error(`${u} contains invalid source map`))}}else{p=f.source();c=null}let d=false;if(this.options.extractComments){d=this.options.extractComments.filename||"[file].LICENSE.txt[query]";if(TerserPlugin.isWebpack4()){if(typeof d==="function"){d=d.bind(null,u)}}let e="";let r=u;const n=r.indexOf("?");if(n>=0){e=r.substr(n);r=r.substr(0,n)}const i=r.lastIndexOf("/");const s=i===-1?r:r.substr(i+1);const o={filename:r,basename:s,query:e};d=t.getPath(d,o)}if(d&&TerserPlugin.hasAsset(d,t.assets)){t.warnings.push(new Error(`The comment file "${TerserPlugin.removeQueryString(d)}" conflicts with an existing asset, this may lead to code corruption, please use a different name`))}const m=r=>{let{code:a}=r;const{error:l,map:f,warnings:m}=r;const{extractedComments:h}=r;let g=null;if(l||m&&m.length>0){g=TerserPlugin.buildSourceMap(c)}if(l){t.errors.push(TerserPlugin.buildError(l,u,g,new o.default(e.context)));return}const b=d&&h&&h.length>0;const y=b&&this.options.extractComments.banner!==false;let v;let _;if(b&&y&&a.startsWith("#!")){const e=a.indexOf("\n");_=a.substring(0,e);a=a.substring(e+1)}if(f){v=new s.SourceMapSource(a,u,f,p,c,true)}else{v=new s.RawSource(a)}if(b){if(!i[d]){i[d]=[]}i[d]=i[d].concat(h);if(y){let e=this.options.extractComments.banner||`For license information please see ${n.default.relative(n.default.dirname(u),d).replace(/\\/g,"/")}`;if(typeof e==="function"){e=e(d)}if(e){v=new s.ConcatSource(_?`${_}\n`:"",`/*! ${e} */\n`,v)}}}t.assets[u]=v;if(m&&m.length>0){m.forEach(r=>{const n=TerserPlugin.buildWarning(r,u,g,new o.default(e.context),this.options.warningsFilter);if(n){t.warnings.push(n)}})}};const h={asset:f,file:u,input:p,inputSourceMap:c,commentsFilename:d,extractComments:this.options.extractComments,terserOptions:this.options.terserOptions,minify:this.options.minify,callback:m};if(TerserPlugin.isWebpack4()){const{outputOptions:{hashSalt:e,hashDigest:n,hashDigestLength:i,hashFunction:s}}=t;const o=a.util.createHash(s);if(e){o.update(e)}o.update(p);const c=o.digest(n);if(this.options.cache){const e={terser:l.default.version,"terser-webpack-plugin":r(135).version,"terser-webpack-plugin-options":this.options,nodeVersion:process.version,filename:u,contentHash:c.substr(0,i)};h.cacheKeys=this.options.cacheKeys(e,u)}}else{h.cacheKeys={terser:l.default.version,"terser-webpack-plugin":r(135).version,"terser-webpack-plugin-options":this.options}}yield h}catch(r){t.errors.push(TerserPlugin.buildError(r,u,TerserPlugin.buildSourceMap(c),new o.default(e.context)))}}apply(e){const{devtool:t,output:n,plugins:i}=e.options;this.options.sourceMap=typeof this.options.sourceMap==="undefined"?t&&!t.includes("eval")&&!t.includes("cheap")&&(t.includes("source-map")||t.includes("sourcemap"))||i&&i.some(e=>e instanceof a.SourceMapDevToolPlugin&&e.options&&e.options.columns):Boolean(this.options.sourceMap);if(typeof this.options.terserOptions.module==="undefined"&&typeof n.module!=="undefined"){this.options.terserOptions.module=n.module}if(typeof this.options.terserOptions.ecma==="undefined"&&typeof n.ecmaVersion!=="undefined"){this.options.terserOptions.ecma=n.ecmaVersion}const o=async(t,n)=>{const i=a.ModuleFilenameHelpers.matchObject.bind(undefined,this.options);const o=[].concat(Array.from(t.additionalChunkAssets||[])).concat(Array.from(n).filter(e=>this.options.chunkFilter&&this.options.chunkFilter(e)).reduce((e,t)=>e.concat(Array.from(t.files||[])),[])).filter(e=>i(e));if(o.length===0){return Promise.resolve()}const u=TerserPlugin.isWebpack4()?r(203).default:r(517).default;const c={};const l=this.taskGenerator.bind(this,e,t,c);const f=new p.default({taskGenerator:l,files:o,cache:new u(e,t,this.options),parallel:this.options.parallel});await f.run();await f.exit();Object.keys(c).forEach(e=>{const r=new Set([...c[e].sort()]);t.assets[e]=new s.RawSource(`${Array.from(r).join("\n\n")}\n`)});return Promise.resolve()};const u={name:this.constructor.name};e.hooks.compilation.tap(u,e=>{if(this.options.sourceMap){e.hooks.buildModule.tap(u,e=>{e.useSourceMap=true})}if(!TerserPlugin.isWebpack4()){const t=a.javascript.JavascriptModulesPlugin.getCompilationHooks(e);const r=(0,c.default)({terser:l.default.version,terserOptions:this.options.terserOptions});t.chunkHash.tap(u,(e,t)=>{t.update("TerserPlugin");t.update(r)})}else{const{mainTemplate:t,chunkTemplate:r}=e;const n=(0,c.default)({terser:l.default.version,terserOptions:this.options.terserOptions});for(const e of[t,r]){e.hooks.hashForChunk.tap(u,e=>{e.update("TerserPlugin");e.update(n)})}}e.hooks.optimizeChunkAssets.tapPromise(u,o.bind(this,e))})}}var m=TerserPlugin;t.default=m},429:function(e){"use strict";const t=(e,...t)=>new Promise(r=>{r(e(...t))});e.exports=t;e.exports.default=t},432:function(e){e.exports=require("webpack/lib/RequestShortener")},496:function(e,t,r){"use strict";e=r.nmd(e);const{minify:n}=r(775);const i=({ecma:e,warnings:t,parse:r={},compress:n={},mangle:i,module:s,output:o,toplevel:a,nameCache:u,ie8:c,keep_classnames:l,keep_fnames:f,safari10:p}={})=>({ecma:e,warnings:t,parse:{...r},compress:typeof n==="boolean"?n:{...n},mangle:i==null?true:typeof i==="boolean"?i:{...i},output:{beautify:false,...o},module:s,sourceMap:null,toplevel:a,nameCache:u,ie8:c,keep_classnames:l,keep_fnames:f,safari10:p});function isObject(e){const t=typeof e;return e!=null&&(t==="object"||t==="function")}const s=(e,t,r)=>{const n={};const i=t.output.comments;const{extractComments:s}=e;n.preserve=typeof i!=="undefined"?i:false;if(typeof s==="boolean"&&s){n.extract="some"}else if(typeof s==="string"||s instanceof RegExp){n.extract=s}else if(typeof s==="function"){n.extract=s}else if(isObject(s)){n.extract=typeof s.condition==="boolean"&&s.condition?"some":typeof s.condition!=="undefined"?s.condition:"some"}else{n.preserve=typeof i!=="undefined"?i:"some";n.extract=false}["preserve","extract"].forEach(e=>{let t;let r;switch(typeof n[e]){case"boolean":n[e]=n[e]?()=>true:()=>false;break;case"function":break;case"string":if(n[e]==="all"){n[e]=(()=>true);break}if(n[e]==="some"){n[e]=((e,t)=>{return t.type==="comment2"&&/@preserve|@lic|@cc_on|^\**!/i.test(t.value)});break}t=n[e];n[e]=((e,r)=>{return new RegExp(t).test(r.value)});break;default:r=n[e];n[e]=((e,t)=>r.test(t.value))}});return(e,t)=>{if(n.extract(e,t)){const e=t.type==="comment2"?`/*${t.value}*/`:`//${t.value}`;if(!r.includes(e)){r.push(e)}}return n.preserve(e,t)}};const o=e=>{const{file:t,input:r,inputSourceMap:o,minify:a}=e;if(a){return a({[t]:r},o)}const u=i(e.terserOptions);if(o){u.sourceMap={asObject:true}}const c=[];u.output.comments=s(e,u,c);const{error:l,map:f,code:p,warnings:d}=n({[t]:r},u);return{error:l,map:f,code:p,warnings:d,extractedComments:c}};function transform(r){r=new Function("exports","require","module","__filename","__dirname",`'use strict'\nreturn ${r}`)(t,require,e,__filename,__dirname);const n=o(r);if(n.error){throw n.error}else{return n}}e.exports.minify=o;e.exports.transform=transform},517:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:true});t.default=void 0;var n=_interopRequireDefault(r(575));var i=_interopRequireDefault(r(946));var s=r(78);function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}class Cache{constructor(e,t,r){this.compiler=e;this.compilation=t;this.options=r}isEnabled(){return!!this.compilation.cache}createCacheIdent(e){const{outputOptions:{hashSalt:t,hashDigest:r,hashDigestLength:n,hashFunction:o}}=this.compilation;const a=s.util.createHash(o);if(t){a.update(t)}a.update((0,i.default)(e.cacheKeys));const u=a.digest(r);const c=u.substr(0,n);return`${this.compilation.compilerPath}/TerserWebpackPlugin/${c}/${e.file}`}get(e){e.cacheIdent=e.cacheIdent||this.createCacheIdent(e);e.cacheETag=e.cacheETag||(0,n.default)(e.asset);return new Promise((t,r)=>{this.compilation.cache.get(e.cacheIdent,e.cacheETag,(e,n)=>{if(e){r(e)}else if(n){t(n)}else{r()}})})}store(e,t){return new Promise((r,n)=>{this.compilation.cache.store(e.cacheIdent,e.cacheETag,t,e=>{if(e){n(e)}else{r(t)}})})}}t.default=Cache},575:function(e){e.exports=require("webpack/lib/cache/getLazyHashedEtag")},622:function(e){e.exports=require("path")},635:function(e){e.exports=require("cacache")},670:function(e){e.exports={additionalProperties:false,definitions:{"file-conditions":{anyOf:[{instanceof:"RegExp"},{type:"string"}]}},properties:{test:{anyOf:[{$ref:"#/definitions/file-conditions"},{items:{anyOf:[{$ref:"#/definitions/file-conditions"}]},type:"array"}]},include:{anyOf:[{$ref:"#/definitions/file-conditions"},{items:{anyOf:[{$ref:"#/definitions/file-conditions"}]},type:"array"}]},exclude:{anyOf:[{$ref:"#/definitions/file-conditions"},{items:{anyOf:[{$ref:"#/definitions/file-conditions"}]},type:"array"}]},chunkFilter:{instanceof:"Function"},cache:{anyOf:[{type:"boolean"},{type:"string"}]},cacheKeys:{instanceof:"Function"},parallel:{anyOf:[{type:"boolean"},{type:"integer"}]},sourceMap:{type:"boolean"},minify:{instanceof:"Function"},terserOptions:{additionalProperties:true,type:"object"},extractComments:{anyOf:[{type:"boolean"},{type:"string"},{instanceof:"RegExp"},{instanceof:"Function"},{additionalProperties:false,properties:{condition:{anyOf:[{type:"boolean"},{type:"string"},{instanceof:"RegExp"},{instanceof:"Function"}]},filename:{anyOf:[{type:"string"},{instanceof:"Function"}]},banner:{anyOf:[{type:"boolean"},{type:"string"},{instanceof:"Function"}]}},type:"object"}]},warningsFilter:{instanceof:"Function"}},type:"object"}},733:function(e){e.exports=require("jest-worker")},745:function(e){e.exports=require("webpack-sources")},775:function(e){e.exports=require("next/dist/compiled/terser")},828:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:true});t.default=void 0;var n=_interopRequireDefault(r(87));var i=_interopRequireDefault(r(341));var s=_interopRequireDefault(r(733));var o=_interopRequireDefault(r(946));var a=r(496);function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}const u=r.ab+"worker.js";class TaskRunner{constructor(e={}){this.taskGenerator=e.taskGenerator;this.files=e.files;this.cache=e.cache;this.availableNumberOfCores=TaskRunner.getAvailableNumberOfCores(e.parallel)}static getAvailableNumberOfCores(e){const t=n.default.cpus()||{length:1};return e===true?t.length-1:Math.min(Number(e)||0,t.length-1)}async runTask(e){if(this.worker){return this.worker.transform((0,o.default)(e))}return(0,a.minify)(e)}async run(){const{availableNumberOfCores:e,cache:t,files:n,taskGenerator:o}=this;let a=Infinity;if(e>0){const t=Math.min(n.length,e);a=t;this.worker=new s.default(r.ab+"worker.js",{numWorkers:t});const i=this.worker.getStdout();if(i){i.on("data",e=>{return process.stdout.write(e)})}const o=this.worker.getStderr();if(o){o.on("data",e=>{return process.stderr.write(e)})}}const u=(0,i.default)(a);const c=[];for(const e of n){const r=async e=>{let r;try{r=await this.runTask(e)}catch(e){r={error:e}}if(t.isEnabled()&&!r.error){r=await t.store(e,r).then(()=>r,()=>r)}e.callback(r);return r};c.push(u(()=>{const n=o(e).next().value;if(!n){return Promise.resolve()}if(t.isEnabled()){return t.get(n).then(e=>n.callback(e),()=>r(n))}return r(n)}))}return Promise.all(c)}async exit(){if(!this.worker){return Promise.resolve()}return this.worker.end()}}t.default=TaskRunner},946:function(e){"use strict";var t=Math.floor(Math.random()*1099511627776).toString(16);var r=new RegExp('"@__(F|R|D|M|S|U)-'+t+'-(\\d+)__@"',"g");var n=/\{\s*\[native code\]\s*\}/g;var i=/function.*?\(/;var s=/.*?=>.*?/;var o=/[<>\/\u2028\u2029]/g;var a=["*","async"];var u={"<":"\\u003C",">":"\\u003E","/":"\\u002F","\u2028":"\\u2028","\u2029":"\\u2029"};function escapeUnsafeChars(e){return u[e]}function deleteFunctions(e){var t=[];for(var r in e){if(typeof e[r]==="function"){t.push(r)}}for(var n=0;n0});var u=o.filter(function(e){return a.indexOf(e)===-1});if(u.length>0){return(o.indexOf("async")>-1?"async ":"")+"function"+(o.join("").indexOf("*")>-1?"*":"")+t.substr(r)}return t}if(u.ignoreFunction&&typeof e==="function"){e=undefined}if(e===undefined){return String(e)}var h;if(u.isJSON&&!u.space){h=JSON.stringify(e)}else{h=JSON.stringify(e,u.isJSON?null:replacer,u.space)}if(typeof h!=="string"){return String(h)}if(u.unsafe!==true){h=h.replace(o,escapeUnsafeChars)}if(c.length===0&&l.length===0&&f.length===0&&p.length===0&&d.length===0&&m.length===0){return h}return h.replace(r,function(e,t,r){if(t==="D"){return'new Date("'+f[r].toISOString()+'")'}if(t==="R"){return"new RegExp("+serialize(l[r].source)+', "'+l[r].flags+'")'}if(t==="M"){return"new Map("+serialize(Array.from(p[r].entries()),u)+")"}if(t==="S"){return"new Set("+serialize(Array.from(d[r].values()),u)+")"}if(t==="U"){return"undefined"}var n=c[r];return serializeFunc(n)})}}},function(e){"use strict";!function(){e.nmd=function(e){e.paths=[];if(!e.children)e.children=[];Object.defineProperty(e,"loaded",{enumerable:true,get:function(){return e.l}});Object.defineProperty(e,"id",{enumerable:true,get:function(){return e.i}});return e}}()}); \ No newline at end of file diff --git a/packages/next/package.json b/packages/next/package.json index 8e5a1c7adb0bd..43bbfd5cf95a7 100644 --- a/packages/next/package.json +++ b/packages/next/package.json @@ -100,7 +100,7 @@ "styled-jsx": "3.2.5", "use-subscription": "1.1.1", "watchpack": "2.0.0-beta.13", - "webpack": "4.42.1", + "webpack": "4.43.0", "webpack-sources": "1.4.3" }, "peerDependencies": { diff --git a/yarn.lock b/yarn.lock index d9cfd89e7c1f3..acdcc7ffb70a1 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3306,6 +3306,11 @@ acorn@^6.0.1, acorn@^6.1.1, acorn@^6.2.1: resolved "https://registry.yarnpkg.com/acorn/-/acorn-6.4.0.tgz#b659d2ffbafa24baf5db1cdbb2c94a983ecd2784" integrity sha512-gac8OEcQ2Li1dxIEWGZzsp2BitJxwkwcOm0zHAJLcPJaVvm58FRnk6RkuLRpU1EujipU2ZFODv2P9DLMfnV8mw== +acorn@^6.4.1: + version "6.4.1" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-6.4.1.tgz#531e58ba3f51b9dacb9a6646ca4debf5b14ca474" + integrity sha512-ZVA9k326Nwrj3Cj9jlh3wGFutC2ZornPNARZwsNYqQYgN0EsV2d53w5RN/co65Ohn4sUAUtb1rSUAOD6XN9idA== + acorn@^7.1.0: version "7.1.0" resolved "https://registry.yarnpkg.com/acorn/-/acorn-7.1.0.tgz#949d36f2c292535da602283586c2477c57eb2d6c" @@ -4722,7 +4727,7 @@ chokidar@^1.7.0: optionalDependencies: fsevents "^1.0.0" -chokidar@^2.0.2: +chokidar@^2.0.2, chokidar@^2.1.8: version "2.1.8" resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-2.1.8.tgz#804b3a7b6a99358c3c5c61e71d8728f041cff917" integrity sha512-ZmZUazfOzf0Nve7duiCKD23PFSCs4JPoYyccjUFF3aQkQadqBhfzhjkwBH2mNOG9cTBwhamM37EIsIkZw3nRgg== @@ -17072,6 +17077,15 @@ watchpack@^1.6.0: graceful-fs "^4.1.2" neo-async "^2.5.0" +watchpack@^1.6.1: + version "1.6.1" + resolved "https://registry.yarnpkg.com/watchpack/-/watchpack-1.6.1.tgz#280da0a8718592174010c078c7585a74cd8cd0e2" + integrity sha512-+IF9hfUFOrYOOaKyfaI7h7dquUIOgyEMoQMLA7OP5FxegKA2+XdXThAZ9TU2kucfhDH7rfMHs1oPYziVGWRnZA== + dependencies: + chokidar "^2.1.8" + graceful-fs "^4.1.2" + neo-async "^2.5.0" + wcwidth@^1.0.0, wcwidth@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/wcwidth/-/wcwidth-1.0.1.tgz#f0b0dcf915bc5ff1528afadb2c0e17b532da2fe8" @@ -17175,6 +17189,35 @@ webpack@4.42.1: watchpack "^1.6.0" webpack-sources "^1.4.1" +webpack@4.43.0: + version "4.43.0" + resolved "https://registry.yarnpkg.com/webpack/-/webpack-4.43.0.tgz#c48547b11d563224c561dad1172c8aa0b8a678e6" + integrity sha512-GW1LjnPipFW2Y78OOab8NJlCflB7EFskMih2AHdvjbpKMeDJqEgSx24cXXXiPS65+WSwVyxtDsJH6jGX2czy+g== + dependencies: + "@webassemblyjs/ast" "1.9.0" + "@webassemblyjs/helper-module-context" "1.9.0" + "@webassemblyjs/wasm-edit" "1.9.0" + "@webassemblyjs/wasm-parser" "1.9.0" + acorn "^6.4.1" + ajv "^6.10.2" + ajv-keywords "^3.4.1" + chrome-trace-event "^1.0.2" + enhanced-resolve "^4.1.0" + eslint-scope "^4.0.3" + json-parse-better-errors "^1.0.2" + loader-runner "^2.4.0" + loader-utils "^1.2.3" + memory-fs "^0.4.1" + micromatch "^3.1.10" + mkdirp "^0.5.3" + neo-async "^2.6.1" + node-libs-browser "^2.2.1" + schema-utils "^1.0.0" + tapable "^1.1.3" + terser-webpack-plugin "^1.4.3" + watchpack "^1.6.1" + webpack-sources "^1.4.1" + websocket-driver@>=0.5.1: version "0.7.3" resolved "https://registry.yarnpkg.com/websocket-driver/-/websocket-driver-0.7.3.tgz#a2d4e0d4f4f116f1e6297eba58b05d430100e9f9"