From defde640c8a2448fe7a5fee95a516af6e1bba8e4 Mon Sep 17 00:00:00 2001 From: Alexander Krasnoyarov Date: Fri, 11 Sep 2020 21:16:04 +0300 Subject: [PATCH] feat: improve caching --- src/Webpack4Cache.js | 105 ++- src/Webpack5Cache.js | 40 +- src/index.js | 683 +++++++++--------- src/minify.js | 16 +- test/TerserPlugin.test.js | 644 +++++++++++++++-- .../TerserPlugin.test.js.snap.webpack4 | 656 +++++++++++++++++ .../TerserPlugin.test.js.snap.webpack5 | 656 +++++++++++++++++ .../cache-option.test.js.snap.webpack4 | 274 +++++++ ...tractComments-option.test.js.snap.webpack4 | 142 +++- ...tractComments-option.test.js.snap.webpack5 | 142 +++- .../worker.test.js.snap.webpack4 | 134 +++- .../worker.test.js.snap.webpack5 | 134 +++- test/cache-option.test.js | 222 +++++- test/exclude-option.test.js | 8 +- test/extractComments-option.test.js | 58 +- test/helpers/BrokenCodePlugin.js | 7 +- test/helpers/ExistingCommentsFile.js | 21 + test/helpers/ModifyExistingAsset.js | 28 + test/helpers/getCompiler.js | 1 - test/helpers/index.js | 4 + test/include-option.test.js | 8 +- test/minify-option.test.js | 30 +- test/parallel-option.test.js | 33 +- test/sourceMap-option.test.js | 52 +- test/terserOptions-option.test.js | 10 +- test/test-option.test.js | 34 +- test/worker.test.js | 250 ++++++- 27 files changed, 3751 insertions(+), 641 deletions(-) create mode 100644 test/helpers/ExistingCommentsFile.js create mode 100644 test/helpers/ModifyExistingAsset.js diff --git a/src/Webpack4Cache.js b/src/Webpack4Cache.js index fa75c0f4..5137c312 100644 --- a/src/Webpack4Cache.js +++ b/src/Webpack4Cache.js @@ -5,31 +5,114 @@ import findCacheDir from 'find-cache-dir'; import serialize from 'serialize-javascript'; export default class Webpack4Cache { - constructor(compilation, options) { - this.cacheDir = + constructor(compilation, options, weakCache) { + this.cache = options.cache === true ? Webpack4Cache.getCacheDirectory() : options.cache; + this.weakCache = weakCache; } static getCacheDirectory() { return findCacheDir({ name: 'terser-webpack-plugin' }) || os.tmpdir(); } - isEnabled() { - return Boolean(this.cacheDir); - } + async get(cacheData, { RawSource, ConcatSource, SourceMapSource }) { + if (!this.cache) { + // eslint-disable-next-line no-undefined + return undefined; + } + + const weakOutput = this.weakCache.get(cacheData.inputSource); + + if (weakOutput) { + return weakOutput; + } - async get(task) { // eslint-disable-next-line no-param-reassign - task.cacheIdent = task.cacheIdent || serialize(task.cacheKeys); + cacheData.cacheIdent = + cacheData.cacheIdent || serialize(cacheData.cacheKeys); + + let cachedResult; + + try { + cachedResult = await cacache.get(this.cache, cacheData.cacheIdent); + } catch (ignoreError) { + // eslint-disable-next-line no-undefined + return undefined; + } + + cachedResult = JSON.parse(cachedResult.data); + + if (cachedResult.target === 'comments') { + return new ConcatSource(cachedResult.value); + } - const { data } = await cacache.get(this.cacheDir, task.cacheIdent); + const { + code, + name, + map, + input, + inputSourceMap, + extractedComments, + } = cachedResult; - return JSON.parse(data); + if (map) { + cachedResult.source = new SourceMapSource( + code, + name, + map, + input, + inputSourceMap, + true + ); + } else { + cachedResult.source = new RawSource(code); + } + + if (extractedComments) { + cachedResult.extractedCommentsSource = new RawSource(extractedComments); + } + + return cachedResult; } - async store(task, data) { - return cacache.put(this.cacheDir, task.cacheIdent, JSON.stringify(data)); + async store(cacheData) { + if (!this.cache) { + // eslint-disable-next-line no-undefined + return undefined; + } + + if (!this.weakCache.has(cacheData.inputSource)) { + if (cacheData.target === 'comments') { + this.weakCache.set(cacheData.inputSource, cacheData.output); + } else { + this.weakCache.set(cacheData.inputSource, cacheData); + } + } + + let data; + + if (cacheData.target === 'comments') { + data = { + target: cacheData.target, + value: cacheData.output.source(), + }; + } else { + data = { + code: cacheData.code, + name: cacheData.name, + map: cacheData.map, + input: cacheData.input, + inputSourceMap: cacheData.inputSourceMap, + }; + + if (cacheData.extractedCommentsSource) { + data.extractedComments = cacheData.extractedCommentsSource.source(); + data.commentsFilename = cacheData.commentsFilename; + } + } + + return cacache.put(this.cache, cacheData.cacheIdent, JSON.stringify(data)); } } diff --git a/src/Webpack5Cache.js b/src/Webpack5Cache.js index 2b6b6fef..bd3b9a23 100644 --- a/src/Webpack5Cache.js +++ b/src/Webpack5Cache.js @@ -1,25 +1,35 @@ export default class Cache { - // eslint-disable-next-line no-unused-vars - constructor(compilation, ignored) { + constructor(compilation) { this.cache = compilation.getCache('TerserWebpackPlugin'); } - // eslint-disable-next-line class-methods-use-this - isEnabled() { - return true; - } - - async get(task) { - // eslint-disable-next-line no-param-reassign - task.cacheIdent = task.cacheIdent || `${task.name}`; + async get(cacheData) { // eslint-disable-next-line no-param-reassign - task.cacheETag = - task.cacheETag || this.cache.getLazyHashedEtag(task.assetSource); + cacheData.eTag = + cacheData.eTag || Array.isArray(cacheData.inputSource) + ? cacheData.inputSource + .map((item) => this.cache.getLazyHashedEtag(item)) + .reduce((previousValue, currentValue) => + this.cache.mergeEtags(previousValue, currentValue) + ) + : this.cache.getLazyHashedEtag(cacheData.inputSource); - return this.cache.getPromise(task.cacheIdent, task.cacheETag); + return this.cache.getPromise(cacheData.name, cacheData.eTag); } - async store(task, data) { - return this.cache.storePromise(task.cacheIdent, task.cacheETag, data); + async store(cacheData) { + let data; + + if (cacheData.target === 'comments') { + data = cacheData.output; + } else { + data = { + source: cacheData.source, + extractedCommentsSource: cacheData.extractedCommentsSource, + commentsFilename: cacheData.commentsFilename, + }; + } + + return this.cache.storePromise(cacheData.name, cacheData.eTag, data); } } diff --git a/src/index.js b/src/index.js index a90404f4..5322b15a 100644 --- a/src/index.js +++ b/src/index.js @@ -132,6 +132,7 @@ class TerserPlugin { return compilation.getAsset(name); } + /* istanbul ignore next */ if (compilation.assets[name]) { return { name, source: compilation.assets[name], info: {} }; } @@ -157,242 +158,45 @@ class TerserPlugin { compilation.assets[name] = newSource; } - *taskGenerator(compiler, compilation, allExtractedComments, name) { - const { info, source: assetSource } = TerserPlugin.getAsset( - compilation, - name - ); - - // Skip double minimize assets from child compilation - if (info.minimized) { - yield false; - } - - let input; - let inputSourceMap; - - // TODO refactor after drop webpack@4, webpack@5 always has `sourceAndMap` on sources - if (this.options.sourceMap && assetSource.sourceAndMap) { - const { source, map } = assetSource.sourceAndMap(); - - input = source; - - if (map) { - if (TerserPlugin.isSourceMap(map)) { - inputSourceMap = map; - } else { - inputSourceMap = map; - - compilation.warnings.push( - new Error(`${name} contains invalid source map`) - ); - } - } - } else { - input = assetSource.source(); - inputSourceMap = null; - } - - if (Buffer.isBuffer(input)) { - input = input.toString(); - } - - // Handling comment extraction - let commentsFilename = false; - - if (this.options.extractComments) { - commentsFilename = - this.options.extractComments.filename || '[file].LICENSE.txt[query]'; - - let query = ''; - let filename = name; - - const querySplit = filename.indexOf('?'); - - if (querySplit >= 0) { - query = filename.substr(querySplit); - filename = filename.substr(0, querySplit); - } - - const lastSlashIndex = filename.lastIndexOf('/'); - const basename = - lastSlashIndex === -1 ? filename : filename.substr(lastSlashIndex + 1); - const data = { filename, basename, query }; - - commentsFilename = compilation.getPath(commentsFilename, data); - } - - const callback = (taskResult) => { - let { code } = taskResult; - const { error, map } = taskResult; - const { extractedComments } = taskResult; - - let sourceMap = null; + async optimize(compiler, compilation, assets, CacheEngine, weakCache) { + let assetNames; - if (error && inputSourceMap && TerserPlugin.isSourceMap(inputSourceMap)) { - sourceMap = new SourceMapConsumer(inputSourceMap); - } - - // Handling results - // Error case: add errors, and go to next file - if (error) { - compilation.errors.push( - TerserPlugin.buildError( - error, - name, - sourceMap, - new RequestShortener(compiler.context) + if (TerserPlugin.isWebpack4()) { + assetNames = [] + .concat(Array.from(compilation.additionalChunkAssets || [])) + .concat( + // In webpack@4 it is `chunks` + Array.from(assets).reduce( + (acc, chunk) => acc.concat(Array.from(chunk.files || [])), + [] ) + ) + .concat(Object.keys(compilation.assets)) + .filter( + (assetName, index, existingAssets) => + existingAssets.indexOf(assetName) === index + ) + .filter((assetName) => + ModuleFilenameHelpers.matchObject.bind( + // eslint-disable-next-line no-undefined + undefined, + this.options + )(assetName) ); - - return; - } - - const hasExtractedComments = - commentsFilename && extractedComments && extractedComments.length > 0; - const hasBannerForExtractedComments = - this.options.extractComments.banner !== false; - - let outputSource; - let shebang; - - if ( - hasExtractedComments && - hasBannerForExtractedComments && - code.startsWith('#!') - ) { - const firstNewlinePosition = code.indexOf('\n'); - - shebang = code.substring(0, firstNewlinePosition); - code = code.substring(firstNewlinePosition + 1); - } - - if (map) { - outputSource = new SourceMapSource( - code, - name, - map, - input, - inputSourceMap, - true - ); - } else { - outputSource = new RawSource(code); - } - - const assetInfo = { ...info, minimized: true }; - - // Write extracted comments to commentsFilename - if (hasExtractedComments) { - let banner; - - assetInfo.related = { license: commentsFilename }; - - // Add a banner to the original file - if (hasBannerForExtractedComments) { - banner = - this.options.extractComments.banner || - `For license information please see ${path - .relative(path.dirname(name), commentsFilename) - .replace(/\\/g, '/')}`; - - if (typeof banner === 'function') { - banner = banner(commentsFilename); - } - - if (banner) { - outputSource = new ConcatSource( - shebang ? `${shebang}\n` : '', - `/*! ${banner} */\n`, - outputSource - ); - } - } - - if (!allExtractedComments[commentsFilename]) { - // eslint-disable-next-line no-param-reassign - allExtractedComments[commentsFilename] = new Set(); - } - - extractedComments.forEach((comment) => { - // Avoid re-adding banner - // Developers can use different banner for different names, but this setting should be avoided, it is not safe - if (banner && comment === `/*! ${banner} */`) { - return; - } - - allExtractedComments[commentsFilename].add(comment); - }); - - // Extracted comments from child compilation - const previousExtractedComments = TerserPlugin.getAsset( - compilation, - commentsFilename - ); - - if (previousExtractedComments) { - const previousExtractedCommentsSource = previousExtractedComments.source.source(); - - // Restore original comments and re-add them - previousExtractedCommentsSource - .replace(/\n$/, '') - .split('\n\n') - .forEach((comment) => { - allExtractedComments[commentsFilename].add(comment); - }); - } - } - - TerserPlugin.updateAsset(compilation, name, outputSource, assetInfo); - }; - - const task = { - name, - input, - inputSourceMap, - commentsFilename, - extractComments: this.options.extractComments, - terserOptions: this.options.terserOptions, - minify: this.options.minify, - callback, - }; - - if (TerserPlugin.isWebpack4()) { - const { - outputOptions: { hashSalt, hashDigest, hashDigestLength, hashFunction }, - } = compilation; - const hash = util.createHash(hashFunction); - - if (hashSalt) { - hash.update(hashSalt); - } - - hash.update(input); - - const digest = hash.digest(hashDigest); - - if (this.options.cache) { - const defaultCacheKeys = { - terser: terserPackageJson.version, - // eslint-disable-next-line global-require - 'terser-webpack-plugin': require('../package.json').version, - 'terser-webpack-plugin-options': this.options, - nodeVersion: process.version, - name, - contentHash: digest.substr(0, hashDigestLength), - }; - - task.cacheKeys = this.options.cacheKeys(defaultCacheKeys, name); - } } else { - // For webpack@5 cache - task.assetSource = assetSource; + assetNames = Object.keys(assets).filter((assetName) => + ModuleFilenameHelpers.matchObject.bind( + // eslint-disable-next-line no-undefined + undefined, + this.options + )(assetName) + ); } - yield task; - } + if (assetNames.length === 0) { + return; + } - async runTasks(assetNames, getTaskForAsset, cache) { const availableNumberOfCores = TerserPlugin.getAvailableNumberOfCores( this.options.parallel ); @@ -427,58 +231,240 @@ class TerserPlugin { } const limit = pLimit(concurrency); + const cache = new CacheEngine( + compilation, + { cache: this.options.cache }, + weakCache + ); + const allExtractedComments = new Map(); const scheduledTasks = []; - for (const assetName of assetNames) { - const enqueue = async (task) => { - let taskResult; + for (const name of assetNames) { + scheduledTasks.push( + limit(async () => { + const { info, source: inputSource } = TerserPlugin.getAsset( + compilation, + name + ); - try { - taskResult = await (worker - ? worker.transform(serialize(task)) - : minifyFn(task)); - } catch (error) { - taskResult = { error }; - } + // Skip double minimize assets from child compilation + if (info.minimized) { + return; + } - if (cache.isEnabled() && !taskResult.error) { - await cache.store(task, taskResult); - } + let input; + let inputSourceMap; - task.callback(taskResult); + // TODO refactor after drop webpack@4, webpack@5 always has `sourceAndMap` on sources + if (this.options.sourceMap && inputSource.sourceAndMap) { + const { source, map } = inputSource.sourceAndMap(); - return taskResult; - }; + input = source; - scheduledTasks.push( - limit(async () => { - const task = getTaskForAsset(assetName).next().value; + if (map) { + if (TerserPlugin.isSourceMap(map)) { + inputSourceMap = map; + } else { + inputSourceMap = map; + + compilation.warnings.push( + new Error(`${name} contains invalid source map`) + ); + } + } + } else { + input = inputSource.source(); + inputSourceMap = null; + } - if (!task) { - // Something went wrong, for example the `cacheKeys` option throw an error - return Promise.resolve(); + if (Buffer.isBuffer(input)) { + input = input.toString(); } - if (cache.isEnabled()) { - let taskResult; + const cacheData = { name, inputSource }; + + if (TerserPlugin.isWebpack4()) { + if (this.options.cache) { + const { + outputOptions: { + hashSalt, + hashDigest, + hashDigestLength, + hashFunction, + }, + } = compilation; + const hash = util.createHash(hashFunction); + + if (hashSalt) { + hash.update(hashSalt); + } + + hash.update(input); + + const digest = hash.digest(hashDigest); + + cacheData.input = input; + cacheData.inputSourceMap = inputSourceMap; + cacheData.cacheKeys = this.options.cacheKeys( + { + terser: terserPackageJson.version, + // eslint-disable-next-line global-require + 'terser-webpack-plugin': require('../package.json').version, + 'terser-webpack-plugin-options': this.options, + name, + contentHash: digest.substr(0, hashDigestLength), + }, + name + ); + } + } else { + cacheData.inputSource = inputSource; + } + + let output = await cache.get(cacheData, { + RawSource, + SourceMapSource, + }); + + if (!output) { + const minimizerOptions = { + name, + input, + inputSourceMap, + minify: this.options.minify, + minimizerOptions: this.options.terserOptions, + extractComments: this.options.extractComments, + }; try { - taskResult = await cache.get(task); - } catch (ignoreError) { - return enqueue(task); + output = await (worker + ? worker.transform(serialize(minimizerOptions)) + : minifyFn(minimizerOptions)); + } catch (error) { + compilation.errors.push( + TerserPlugin.buildError( + error, + name, + inputSourceMap && TerserPlugin.isSourceMap(inputSourceMap) + ? new SourceMapConsumer(inputSourceMap) + : null, + new RequestShortener(compiler.context) + ) + ); + + return; + } + + let shebang; + + if ( + this.options.extractComments.banner !== false && + output.extractedComments && + output.extractedComments.length > 0 && + output.code.startsWith('#!') + ) { + const firstNewlinePosition = output.code.indexOf('\n'); + + shebang = output.code.substring(0, firstNewlinePosition); + output.code = output.code.substring(firstNewlinePosition + 1); } - // Webpack@5 return `undefined` when cache is not found - if (!taskResult) { - return enqueue(task); + if (output.map) { + output.source = new SourceMapSource( + output.code, + name, + output.map, + input, + inputSourceMap, + true + ); + } else { + output.source = new RawSource(output.code); } - task.callback(taskResult); + let commentsFilename; + + if ( + output.extractedComments && + output.extractedComments.length > 0 + ) { + commentsFilename = + this.options.extractComments.filename || + '[file].LICENSE.txt[query]'; + + let query = ''; + let filename = name; + + const querySplit = filename.indexOf('?'); + + if (querySplit >= 0) { + query = filename.substr(querySplit); + filename = filename.substr(0, querySplit); + } + + const lastSlashIndex = filename.lastIndexOf('/'); + const basename = + lastSlashIndex === -1 + ? filename + : filename.substr(lastSlashIndex + 1); + const data = { filename, basename, query }; + + commentsFilename = compilation.getPath(commentsFilename, data); + + output.commentsFilename = commentsFilename; + + let banner; + + // Add a banner to the original file + if (this.options.extractComments.banner !== false) { + banner = + this.options.extractComments.banner || + `For license information please see ${path + .relative(path.dirname(name), commentsFilename) + .replace(/\\/g, '/')}`; + + if (typeof banner === 'function') { + banner = banner(commentsFilename); + } + + if (banner) { + output.source = new ConcatSource( + shebang ? `${shebang}\n` : '', + `/*! ${banner} */\n`, + output.source + ); + } + } + + const extractedCommentsString = output.extractedComments + .sort() + .join('\n\n'); + + output.extractedCommentsSource = new RawSource( + `${extractedCommentsString}\n` + ); + } + + await cache.store({ ...output, ...cacheData }); + } + + // TODO `...` required only for webpack@4 + const newInfo = { ...info, minimized: true }; + const { source, extractedCommentsSource } = output; + + // Write extracted comments to commentsFilename + if (extractedCommentsSource) { + const { commentsFilename } = output; - return Promise.resolve(); + newInfo.related = { license: commentsFilename }; + + allExtractedComments.set(name, { + extractedCommentsSource, + commentsFilename, + }); } - return enqueue(task); + TerserPlugin.updateAsset(compilation, name, source, newInfo); }) ); } @@ -488,6 +474,98 @@ class TerserPlugin { if (worker) { await worker.end(); } + + await Array.from(allExtractedComments) + .sort() + .reduce(async (previousPromise, [from, value]) => { + const previous = await previousPromise; + const { commentsFilename, extractedCommentsSource } = value; + + if (previous && previous.commentsFilename === commentsFilename) { + const { from: previousFrom, source: prevSource } = previous; + const mergedName = `${previousFrom}|${from}`; + + const cacheData = { + target: 'comments', + }; + + if (TerserPlugin.isWebpack4()) { + const { + outputOptions: { + hashSalt, + hashDigest, + hashDigestLength, + hashFunction, + }, + } = compilation; + const previousHash = util.createHash(hashFunction); + const hash = util.createHash(hashFunction); + + if (hashSalt) { + previousHash.update(hashSalt); + hash.update(hashSalt); + } + + previousHash.update(prevSource.source()); + hash.update(extractedCommentsSource.source()); + + const previousDigest = previousHash.digest(hashDigest); + const digest = hash.digest(hashDigest); + + cacheData.cacheKeys = { + mergedName, + previousContentHash: previousDigest.substr(0, hashDigestLength), + contentHash: digest.substr(0, hashDigestLength), + }; + cacheData.inputSource = extractedCommentsSource; + } else { + const mergedInputSource = [prevSource, extractedCommentsSource]; + + cacheData.name = `${commentsFilename}|${mergedName}`; + cacheData.inputSource = mergedInputSource; + } + + let output = await cache.get(cacheData, { ConcatSource }); + + if (!output) { + output = new ConcatSource( + Array.from( + new Set([ + ...prevSource.source().split('\n\n'), + ...extractedCommentsSource.source().split('\n\n'), + ]) + ).join('\n\n') + ); + + await cache.store({ ...cacheData, output }); + } + + TerserPlugin.updateAsset(compilation, commentsFilename, output); + + return { commentsFilename, from: mergedName, source: output }; + } + + const existingAsset = TerserPlugin.getAsset( + compilation, + commentsFilename + ); + + if (existingAsset) { + return { + commentsFilename, + from: commentsFilename, + source: existingAsset.source, + }; + } + + TerserPlugin.emitAsset( + compilation, + commentsFilename, + extractedCommentsSource + ); + + return { commentsFilename, from, source: extractedCommentsSource }; + }, Promise.resolve()); } apply(compiler) { @@ -524,71 +602,13 @@ class TerserPlugin { this.options.terserOptions.ecma = output.ecmaVersion; } - const matchObject = ModuleFilenameHelpers.matchObject.bind( - // eslint-disable-next-line no-undefined - undefined, - this.options - ); - - const optimizeFn = async (compilation, chunksOrAssets) => { - let assetNames; - - if (TerserPlugin.isWebpack4()) { - assetNames = [] - .concat(Array.from(compilation.additionalChunkAssets || [])) - .concat( - Array.from(chunksOrAssets).reduce( - (acc, chunk) => acc.concat(Array.from(chunk.files || [])), - [] - ) - ) - .concat(Object.keys(compilation.assets)) - .filter((file, index, assets) => assets.indexOf(file) === index) - .filter((file) => matchObject(file)); - } else { - assetNames = [] - .concat(Object.keys(chunksOrAssets)) - .filter((file) => matchObject(file)); - } - - if (assetNames.length === 0) { - return Promise.resolve(); - } - - const allExtractedComments = {}; - const getTaskForAsset = this.taskGenerator.bind( - this, - compiler, - compilation, - allExtractedComments - ); - const CacheEngine = TerserPlugin.isWebpack4() - ? // eslint-disable-next-line global-require - require('./Webpack4Cache').default - : // eslint-disable-next-line global-require - require('./Webpack5Cache').default; - const cache = new CacheEngine(compilation, { cache: this.options.cache }); - - await this.runTasks(assetNames, getTaskForAsset, cache); - - Object.keys(allExtractedComments).forEach((commentsFilename) => { - const extractedComments = Array.from( - allExtractedComments[commentsFilename] - ) - .sort() - .join('\n\n'); - - TerserPlugin.emitAsset( - compilation, - commentsFilename, - new RawSource(`${extractedComments}\n`) - ); - }); - - return Promise.resolve(); - }; - const pluginName = this.constructor.name; + const weakCache = + TerserPlugin.isWebpack4() && + (this.options.cache === true || typeof this.options.cache === 'string') + ? new WeakMap() + : // eslint-disable-next-line no-undefined + undefined; compiler.hooks.compilation.tap(pluginName, (compilation) => { if (this.options.sourceMap) { @@ -600,6 +620,8 @@ class TerserPlugin { } if (TerserPlugin.isWebpack4()) { + // eslint-disable-next-line global-require + const CacheEngine = require('./Webpack4Cache').default; const { mainTemplate, chunkTemplate } = compilation; const data = serialize({ terser: terserPackageJson.version, @@ -614,11 +636,12 @@ class TerserPlugin { }); } - compilation.hooks.optimizeChunkAssets.tapPromise( - pluginName, - optimizeFn.bind(this, compilation) + compilation.hooks.optimizeChunkAssets.tapPromise(pluginName, (assets) => + this.optimize(compiler, compilation, assets, CacheEngine, weakCache) ); } else { + // eslint-disable-next-line global-require + const CacheEngine = require('./Webpack5Cache').default; // eslint-disable-next-line global-require const Compilation = require('webpack/lib/Compilation'); const hooks = javascript.JavascriptModulesPlugin.getCompilationHooks( @@ -639,7 +662,7 @@ class TerserPlugin { name: pluginName, stage: Compilation.PROCESS_ASSETS_STAGE_OPTIMIZE_SIZE, }, - optimizeFn.bind(this, compilation) + (assets) => this.optimize(compiler, compilation, assets, CacheEngine) ); compilation.hooks.statsPrinter.tap(pluginName, (stats) => { diff --git a/src/minify.js b/src/minify.js index 63b4e3cb..b5596750 100644 --- a/src/minify.js +++ b/src/minify.js @@ -47,13 +47,11 @@ function isObject(value) { return value != null && (type === 'object' || type === 'function'); } -const buildComments = (options, terserOptions, extractedComments) => { +const buildComments = (extractComments, terserOptions, extractedComments) => { const condition = {}; - const commentsOpts = terserOptions.output.comments; - const { extractComments } = options; + const { comments } = terserOptions.output; - condition.preserve = - typeof commentsOpts !== 'undefined' ? commentsOpts : false; + condition.preserve = typeof comments !== 'undefined' ? comments : false; if (typeof extractComments === 'boolean' && extractComments) { condition.extract = 'some'; @@ -75,8 +73,7 @@ const buildComments = (options, terserOptions, extractedComments) => { } else { // No extract // Preserve using "commentsOpts" or "some" - condition.preserve = - typeof commentsOpts !== 'undefined' ? commentsOpts : 'some'; + condition.preserve = typeof comments !== 'undefined' ? comments : 'some'; condition.extract = false; } @@ -151,7 +148,7 @@ async function minify(options) { } // Copy terser options - const terserOptions = buildTerserOptions(options.terserOptions); + const terserOptions = buildTerserOptions(options.minimizerOptions); // Let terser generate a SourceMap if (inputSourceMap) { @@ -159,9 +156,10 @@ async function minify(options) { } const extractedComments = []; + const { extractComments } = options; terserOptions.output.comments = buildComments( - options, + extractComments, terserOptions, extractedComments ); diff --git a/test/TerserPlugin.test.js b/test/TerserPlugin.test.js index 99350b2c..99bbc799 100644 --- a/test/TerserPlugin.test.js +++ b/test/TerserPlugin.test.js @@ -13,6 +13,7 @@ import TerserPlugin from '../src/index'; import { BrokenCodePlugin, + ModifyExistingAsset, compile, countPlugins, getCompiler, @@ -63,9 +64,9 @@ describe('TerserPlugin', () => { mode: 'production', bail: true, cache: getCompiler.isWebpack4() ? false : { type: 'memory' }, - entry: `${__dirname}/fixtures/entry.js`, + entry: path.resolve(__dirname, './fixtures/entry.js'), output: { - path: `${__dirname}/dist`, + path: path.resolve(__dirname, './dist'), filename: '[name]-1.js', chunkFilename: '[id]-1.[name].js', }, @@ -77,9 +78,9 @@ describe('TerserPlugin', () => { mode: 'production', bail: true, cache: getCompiler.isWebpack4() ? false : { type: 'memory' }, - entry: `${__dirname}/fixtures/entry.js`, + entry: path.resolve(__dirname, './fixtures/entry.js'), output: { - path: `${__dirname}/dist`, + path: path.resolve(__dirname, './dist'), filename: '[name]-2.js', chunkFilename: '[id]-2.[name].js', }, @@ -92,9 +93,9 @@ describe('TerserPlugin', () => { mode: 'production', bail: true, cache: getCompiler.isWebpack4() ? false : { type: 'memory' }, - entry: `${__dirname}/fixtures/import-export/entry.js`, + entry: path.resolve(__dirname, './fixtures/import-export/entry.js'), output: { - path: `${__dirname}/dist-MultiCompiler`, + path: path.resolve(__dirname, './dist-MultiCompiler'), filename: '[name]-3.js', chunkFilename: '[id]-3.[name].js', }, @@ -158,9 +159,9 @@ describe('TerserPlugin', () => { mode: 'production', bail: true, cache: getCompiler.isWebpack4() ? false : { type: 'memory' }, - entry: `${__dirname}/fixtures/entry.js`, + entry: path.resolve(__dirname, './fixtures/entry.js'), output: { - path: `${__dirname}/dist`, + path: path.resolve(__dirname, './dist'), filename: '[name]-1.js', chunkFilename: '[id]-1.[name].js', }, @@ -172,9 +173,9 @@ describe('TerserPlugin', () => { mode: 'production', bail: true, cache: getCompiler.isWebpack4() ? false : { type: 'memory' }, - entry: `${__dirname}/fixtures/entry.js`, + entry: path.resolve(__dirname, './fixtures/entry.js'), output: { - path: `${__dirname}/dist`, + path: path.resolve(__dirname, './dist'), filename: '[name]-2.js', chunkFilename: '[id]-2.[name].js', }, @@ -187,9 +188,9 @@ describe('TerserPlugin', () => { mode: 'production', bail: true, cache: getCompiler.isWebpack4() ? false : { type: 'memory' }, - entry: `${__dirname}/fixtures/import-export/entry.js`, + entry: path.resolve(__dirname, './fixtures/import-export/entry.js'), output: { - path: `${__dirname}/dist-MultiCompiler`, + path: path.resolve(__dirname, './dist-MultiCompiler'), filename: '[name]-3.js', chunkFilename: '[id]-3.[name].js', }, @@ -231,9 +232,9 @@ describe('TerserPlugin', () => { mode: 'production', bail: true, cache: getCompiler.isWebpack4() ? false : { type: 'memory' }, - entry: `${__dirname}/fixtures/entry.js`, + entry: path.resolve(__dirname, './fixtures/entry.js'), output: { - path: `${__dirname}/dist-0`, + path: path.resolve(__dirname, './dist-0'), filename: '[name].js', chunkFilename: '[id].[name].js', }, @@ -246,9 +247,9 @@ describe('TerserPlugin', () => { mode: 'production', bail: true, cache: getCompiler.isWebpack4() ? false : { type: 'memory' }, - entry: `${__dirname}/fixtures/entry.js`, + entry: path.resolve(__dirname, './fixtures/entry.js'), output: { - path: `${__dirname}/dist-1`, + path: path.resolve(__dirname, './dist-1'), filename: '[name].js', chunkFilename: '[id].[name].js', }, @@ -261,9 +262,9 @@ describe('TerserPlugin', () => { mode: 'production', bail: true, cache: getCompiler.isWebpack4() ? false : { type: 'memory' }, - entry: `${__dirname}/fixtures/entry.js`, + entry: path.resolve(__dirname, './fixtures/entry.js'), output: { - path: `${__dirname}/dist-2`, + path: path.resolve(__dirname, './dist-2'), filename: '[name].js', chunkFilename: '[id].[name].js', }, @@ -276,9 +277,9 @@ describe('TerserPlugin', () => { mode: 'production', bail: true, cache: getCompiler.isWebpack4() ? false : { type: 'memory' }, - entry: `${__dirname}/fixtures/entry.js`, + entry: path.resolve(__dirname, './fixtures/entry.js'), output: { - path: `${__dirname}/dist-3`, + path: path.resolve(__dirname, './dist-3'), filename: '[name].js', chunkFilename: '[id].[name].js', }, @@ -291,9 +292,9 @@ describe('TerserPlugin', () => { mode: 'production', bail: true, cache: getCompiler.isWebpack4() ? false : { type: 'memory' }, - entry: `${__dirname}/fixtures/entry.js`, + entry: path.resolve(__dirname, './fixtures/entry.js'), output: { - path: `${__dirname}/dist-4`, + path: path.resolve(__dirname, './dist-4'), filename: '[name].js', chunkFilename: '[id].[name].js', }, @@ -442,13 +443,19 @@ describe('TerserPlugin', () => { const compiler = getCompiler({ entry: { - js: `${__dirname}/fixtures/entry.js`, - mjs: `${__dirname}/fixtures/entry.mjs`, - importExport: `${__dirname}/fixtures/import-export/entry.js`, - AsyncImportExport: `${__dirname}/fixtures/async-import-export/entry.js`, + js: path.resolve(__dirname, './fixtures/entry.js'), + mjs: path.resolve(__dirname, './fixtures/entry.mjs'), + importExport: path.resolve( + __dirname, + './fixtures/import-export/entry.js' + ), + AsyncImportExport: path.resolve( + __dirname, + './fixtures/async-import-export/entry.js' + ), }, output: { - path: `${__dirname}/dist`, + path: path.resolve(__dirname, './dist'), filename: '[name].[contenthash].js', chunkFilename: '[id].[name].[contenthash].js', }, @@ -478,13 +485,19 @@ describe('TerserPlugin', () => { const mockUpdateHashForChunk = jest.fn(); const compiler = getCompiler({ entry: { - js: `${__dirname}/fixtures/entry.js`, - mjs: `${__dirname}/fixtures/entry.mjs`, - importExport: `${__dirname}/fixtures/import-export/entry.js`, - AsyncImportExport: `${__dirname}/fixtures/async-import-export/entry.js`, + js: path.resolve(__dirname, './fixtures/entry.js'), + mjs: path.resolve(__dirname, './fixtures/entry.mjs'), + importExport: path.resolve( + __dirname, + './fixtures/import-export/entry.js' + ), + AsyncImportExport: path.resolve( + __dirname, + './fixtures/async-import-export/entry.js' + ), }, output: { - path: `${__dirname}/dist`, + path: path.resolve(__dirname, './dist'), filename: '[name].[contenthash].js', chunkFilename: '[id].[name].[contenthash].js', }, @@ -631,8 +644,8 @@ describe('TerserPlugin', () => { it('should emit an error on a broken code in parallel mode', async () => { const compiler = getCompiler({ entry: { - one: `${__dirname}/fixtures/entry.js`, - two: `${__dirname}/fixtures/entry.js`, + one: path.resolve(__dirname, './fixtures/entry.js'), + two: path.resolve(__dirname, './fixtures/entry.js'), }, optimization: { minimize: false, @@ -654,8 +667,8 @@ describe('TerserPlugin', () => { it('should emit an error on a broken code in not parallel mode', async () => { const compiler = getCompiler({ entry: { - one: `${__dirname}/fixtures/entry.js`, - two: `${__dirname}/fixtures/entry.js`, + one: path.resolve(__dirname, './fixtures/entry.js'), + two: path.resolve(__dirname, './fixtures/entry.js'), }, optimization: { minimize: false, @@ -691,8 +704,8 @@ describe('TerserPlugin', () => { const compiler = getCompiler({ entry: { - one: `${__dirname}/fixtures/empty.js`, - two: `${__dirname}/fixtures/empty.js`, + one: path.resolve(__dirname, './fixtures/empty.js'), + two: path.resolve(__dirname, './fixtures/empty.js'), }, }); @@ -737,8 +750,8 @@ describe('TerserPlugin', () => { const compiler = getCompiler({ entry: { - one: `${__dirname}/fixtures/empty.js`, - two: `${__dirname}/fixtures/empty.js`, + one: path.resolve(__dirname, './fixtures/empty.js'), + two: path.resolve(__dirname, './fixtures/empty.js'), }, }); @@ -818,9 +831,11 @@ describe('TerserPlugin', () => { new TerserPlugin().apply(compiler); const stats = await compile(compiler); + const stringStats = stats.toString({ relatedAssets: true }); + const printedCompressed = stringStats.match(/\[minimized]/g); - expect(stats.toString().indexOf('[minimized]') !== -1).toBe( - !getCompiler.isWebpack4() + expect(printedCompressed ? printedCompressed.length : 0).toBe( + getCompiler.isWebpack4() ? 0 : 1 ); expect(readsAssets(compiler, stats)).toMatchSnapshot('assets'); expect(getErrors(stats)).toMatchSnapshot('errors'); @@ -829,7 +844,7 @@ describe('TerserPlugin', () => { it('should work and show related assets in stats', async () => { const compiler = getCompiler({ - entry: { comments: `${__dirname}/fixtures/comments-4.js` }, + entry: { comments: path.resolve(__dirname, './fixtures/comments-4.js') }, devtool: 'source-map', }); @@ -892,4 +907,547 @@ describe('TerserPlugin', () => { expect(getWarnings(stats)).toMatchSnapshot('warnings'); } }); + + it('should work and use memory cache when the "cache" option is "true"', async () => { + const compiler = getCompiler({ + entry: { + js: path.resolve(__dirname, './fixtures/entry.js'), + mjs: path.resolve(__dirname, './fixtures/entry.mjs'), + importExport: path.resolve( + __dirname, + './fixtures/import-export/entry.js' + ), + AsyncImportExport: path.resolve( + __dirname, + './fixtures/async-import-export/entry.js' + ), + }, + cache: true, + output: { + path: path.resolve(__dirname, './dist'), + filename: '[name].js', + chunkFilename: '[id].[name].js', + }, + }); + + new TerserPlugin().apply(compiler); + + const stats = await compile(compiler); + + if (getCompiler.isWebpack4()) { + expect( + Object.keys(stats.compilation.assets).filter( + (assetName) => stats.compilation.assets[assetName].emitted + ).length + ).toBe(5); + } else { + expect(stats.compilation.emittedAssets.size).toBe(5); + } + + expect(readsAssets(compiler, stats)).toMatchSnapshot('assets'); + expect(getWarnings(stats)).toMatchSnapshot('errors'); + expect(getErrors(stats)).toMatchSnapshot('warnings'); + + await new Promise(async (resolve) => { + const newStats = await compile(compiler); + + if (getCompiler.isWebpack4()) { + expect( + Object.keys(newStats.compilation.assets).filter( + (assetName) => newStats.compilation.assets[assetName].emitted + ).length + ).toBe(0); + } else { + expect(newStats.compilation.emittedAssets.size).toBe(0); + } + + expect(readsAssets(compiler, stats)).toMatchSnapshot('assets'); + expect(getWarnings(newStats)).toMatchSnapshot('errors'); + expect(getErrors(newStats)).toMatchSnapshot('warnings'); + + resolve(); + }); + }); + + it('should work and use memory cache when the "cache" option is "true" and the asset has been changed', async () => { + const compiler = getCompiler({ + entry: { + js: path.resolve(__dirname, './fixtures/entry.js'), + mjs: path.resolve(__dirname, './fixtures/entry.mjs'), + importExport: path.resolve( + __dirname, + './fixtures/import-export/entry.js' + ), + AsyncImportExport: path.resolve( + __dirname, + './fixtures/async-import-export/entry.js' + ), + }, + cache: true, + output: { + path: path.resolve(__dirname, './dist'), + filename: '[name].js', + chunkFilename: '[id].[name].js', + }, + }); + + new TerserPlugin().apply(compiler); + + const stats = await compile(compiler); + + if (getCompiler.isWebpack4()) { + expect( + Object.keys(stats.compilation.assets).filter( + (assetName) => stats.compilation.assets[assetName].emitted + ).length + ).toBe(5); + } else { + expect(stats.compilation.emittedAssets.size).toBe(5); + } + + expect(readsAssets(compiler, stats)).toMatchSnapshot('assets'); + expect(getWarnings(stats)).toMatchSnapshot('errors'); + expect(getErrors(stats)).toMatchSnapshot('warnings'); + + new ModifyExistingAsset({ name: 'js.js' }).apply(compiler); + + await new Promise(async (resolve) => { + const newStats = await compile(compiler); + + if (getCompiler.isWebpack4()) { + expect( + Object.keys(newStats.compilation.assets).filter( + (assetName) => newStats.compilation.assets[assetName].emitted + ).length + ).toBe(1); + } else { + expect(newStats.compilation.emittedAssets.size).toBe(1); + } + + expect(readsAssets(compiler, stats)).toMatchSnapshot('assets'); + expect(getWarnings(newStats)).toMatchSnapshot('errors'); + expect(getErrors(newStats)).toMatchSnapshot('warnings'); + + resolve(); + }); + }); + + it('should work with source map and use memory cache when the "cache" option is "true"', async () => { + const compiler = getCompiler({ + devtool: 'source-map', + entry: { + js: path.resolve(__dirname, './fixtures/entry.js'), + mjs: path.resolve(__dirname, './fixtures/entry.mjs'), + importExport: path.resolve( + __dirname, + './fixtures/import-export/entry.js' + ), + AsyncImportExport: path.resolve( + __dirname, + './fixtures/async-import-export/entry.js' + ), + }, + cache: true, + output: { + path: path.resolve(__dirname, './dist'), + filename: '[name].js', + chunkFilename: '[id].[name].js', + }, + }); + + new TerserPlugin().apply(compiler); + + const stats = await compile(compiler); + + if (getCompiler.isWebpack4()) { + expect( + Object.keys(stats.compilation.assets).filter( + (assetName) => stats.compilation.assets[assetName].emitted + ).length + ).toBe(10); + } else { + expect(stats.compilation.emittedAssets.size).toBe(10); + } + + expect(readsAssets(compiler, stats)).toMatchSnapshot('assets'); + expect(getWarnings(stats)).toMatchSnapshot('errors'); + expect(getErrors(stats)).toMatchSnapshot('warnings'); + + await new Promise(async (resolve) => { + const newStats = await compile(compiler); + + if (getCompiler.isWebpack4()) { + expect( + Object.keys(newStats.compilation.assets).filter( + (assetName) => newStats.compilation.assets[assetName].emitted + ).length + ).toBe(0); + } else { + expect(newStats.compilation.emittedAssets.size).toBe(0); + } + + expect(readsAssets(compiler, stats)).toMatchSnapshot('assets'); + expect(getWarnings(newStats)).toMatchSnapshot('errors'); + expect(getErrors(newStats)).toMatchSnapshot('warnings'); + + resolve(); + }); + }); + + it('should work with source map and use memory cache when the "cache" option is "true" and the asset has been changed', async () => { + const compiler = getCompiler({ + devtool: 'source-map', + entry: { + js: path.resolve(__dirname, './fixtures/entry.js'), + mjs: path.resolve(__dirname, './fixtures/entry.mjs'), + importExport: path.resolve( + __dirname, + './fixtures/import-export/entry.js' + ), + AsyncImportExport: path.resolve( + __dirname, + './fixtures/async-import-export/entry.js' + ), + }, + cache: true, + output: { + path: path.resolve(__dirname, './dist'), + filename: '[name].js', + chunkFilename: '[id].[name].js', + }, + }); + + new TerserPlugin().apply(compiler); + + const stats = await compile(compiler); + + if (getCompiler.isWebpack4()) { + expect( + Object.keys(stats.compilation.assets).filter( + (assetName) => stats.compilation.assets[assetName].emitted + ).length + ).toBe(10); + } else { + expect(stats.compilation.emittedAssets.size).toBe(10); + } + + expect(readsAssets(compiler, stats)).toMatchSnapshot('assets'); + expect(getWarnings(stats)).toMatchSnapshot('errors'); + expect(getErrors(stats)).toMatchSnapshot('warnings'); + + new ModifyExistingAsset({ name: 'js.js' }).apply(compiler); + + await new Promise(async (resolve) => { + const newStats = await compile(compiler); + + if (getCompiler.isWebpack4()) { + expect( + Object.keys(newStats.compilation.assets).filter( + (assetName) => newStats.compilation.assets[assetName].emitted + ).length + ).toBe(2); + } else { + expect(newStats.compilation.emittedAssets.size).toBe(2); + } + + expect(readsAssets(compiler, stats)).toMatchSnapshot('assets'); + expect(getWarnings(newStats)).toMatchSnapshot('errors'); + expect(getErrors(newStats)).toMatchSnapshot('warnings'); + + resolve(); + }); + }); + + it('should work, extract comments in different files and use memory cache memory cache when the "cache" option is "true"', async () => { + const compiler = getCompiler({ + entry: { + one: path.resolve(__dirname, './fixtures/comments.js'), + two: path.resolve(__dirname, './fixtures/comments-2.js'), + three: path.resolve(__dirname, './fixtures/comments-3.js'), + four: path.resolve(__dirname, './fixtures/comments-4.js'), + }, + cache: true, + output: { + path: path.resolve(__dirname, './dist'), + filename: '[name].js', + chunkFilename: '[id].[name].js', + }, + }); + + new TerserPlugin().apply(compiler); + + const stats = await compile(compiler); + + if (getCompiler.isWebpack4()) { + expect( + Object.keys(stats.compilation.assets).filter( + (assetName) => stats.compilation.assets[assetName].emitted + ).length + ).toBe(10); + } else { + expect(stats.compilation.emittedAssets.size).toBe(10); + } + + expect(readsAssets(compiler, stats)).toMatchSnapshot('assets'); + expect(getWarnings(stats)).toMatchSnapshot('errors'); + expect(getErrors(stats)).toMatchSnapshot('warnings'); + + await new Promise(async (resolve) => { + const newStats = await compile(compiler); + + if (getCompiler.isWebpack4()) { + expect( + Object.keys(newStats.compilation.assets).filter( + (assetName) => newStats.compilation.assets[assetName].emitted + ).length + ).toBe(0); + } else { + expect(newStats.compilation.emittedAssets.size).toBe(0); + } + + expect(readsAssets(compiler, stats)).toMatchSnapshot('assets'); + expect(getWarnings(newStats)).toMatchSnapshot('errors'); + expect(getErrors(newStats)).toMatchSnapshot('warnings'); + + resolve(); + }); + }); + + it('should work, extract comments in different files and use memory cache memory cache when the "cache" option is "true" and the asset has been changed', async () => { + const compiler = getCompiler({ + entry: { + one: path.resolve(__dirname, './fixtures/comments.js'), + two: path.resolve(__dirname, './fixtures/comments-2.js'), + three: path.resolve(__dirname, './fixtures/comments-3.js'), + four: path.resolve(__dirname, './fixtures/comments-4.js'), + }, + cache: true, + output: { + path: path.resolve(__dirname, './dist'), + filename: '[name].js', + chunkFilename: '[id].[name].js', + }, + }); + + new TerserPlugin().apply(compiler); + + const stats = await compile(compiler); + + if (getCompiler.isWebpack4()) { + expect( + Object.keys(stats.compilation.assets).filter( + (assetName) => stats.compilation.assets[assetName].emitted + ).length + ).toBe(10); + } else { + expect(stats.compilation.emittedAssets.size).toBe(10); + } + + expect(readsAssets(compiler, stats)).toMatchSnapshot('assets'); + expect(getWarnings(stats)).toMatchSnapshot('errors'); + expect(getErrors(stats)).toMatchSnapshot('warnings'); + + new ModifyExistingAsset({ name: 'two.js', comment: true }).apply(compiler); + + await new Promise(async (resolve) => { + const newStats = await compile(compiler); + + if (getCompiler.isWebpack4()) { + expect( + Object.keys(newStats.compilation.assets).filter( + (assetName) => newStats.compilation.assets[assetName].emitted + ).length + ).toBe(2); + } else { + expect(newStats.compilation.emittedAssets.size).toBe(2); + } + + expect(readsAssets(compiler, stats)).toMatchSnapshot('assets'); + expect(getWarnings(newStats)).toMatchSnapshot('errors'); + expect(getErrors(newStats)).toMatchSnapshot('warnings'); + + resolve(); + }); + }); + + it('should work, extract comments in one file and use memory cache memory cache when the "cache" option is "true"', async () => { + const compiler = getCompiler({ + entry: { + one: path.resolve(__dirname, './fixtures/comments.js'), + two: path.resolve(__dirname, './fixtures/comments-2.js'), + three: path.resolve(__dirname, './fixtures/comments-3.js'), + four: path.resolve(__dirname, './fixtures/comments-4.js'), + }, + cache: true, + output: { + path: path.resolve(__dirname, './dist'), + filename: '[name].js', + chunkFilename: '[id].[name].js', + }, + }); + + new TerserPlugin({ + extractComments: { + filename: 'licenses.txt', + }, + }).apply(compiler); + + const stats = await compile(compiler); + + if (getCompiler.isWebpack4()) { + expect( + Object.keys(stats.compilation.assets).filter( + (assetName) => stats.compilation.assets[assetName].emitted + ).length + ).toBe(6); + } else { + expect(stats.compilation.emittedAssets.size).toBe(6); + } + + expect(readsAssets(compiler, stats)).toMatchSnapshot('assets'); + expect(getWarnings(stats)).toMatchSnapshot('errors'); + expect(getErrors(stats)).toMatchSnapshot('warnings'); + + await new Promise(async (resolve) => { + const newStats = await compile(compiler); + + if (getCompiler.isWebpack4()) { + expect( + Object.keys(newStats.compilation.assets).filter( + (assetName) => newStats.compilation.assets[assetName].emitted + ).length + ).toBe(0); + } else { + expect(newStats.compilation.emittedAssets.size).toBe(0); + } + + expect(readsAssets(compiler, stats)).toMatchSnapshot('assets'); + expect(getWarnings(newStats)).toMatchSnapshot('errors'); + expect(getErrors(newStats)).toMatchSnapshot('warnings'); + + resolve(); + }); + }); + + it('should work, extract comments in one file and use memory cache memory cache when the "cache" option is "true" and the asset has been changed', async () => { + const compiler = getCompiler({ + entry: { + one: path.resolve(__dirname, './fixtures/comments.js'), + two: path.resolve(__dirname, './fixtures/comments-2.js'), + three: path.resolve(__dirname, './fixtures/comments-3.js'), + four: path.resolve(__dirname, './fixtures/comments-4.js'), + }, + cache: true, + output: { + path: path.resolve(__dirname, './dist'), + filename: '[name].js', + chunkFilename: '[id].[name].js', + }, + }); + + new TerserPlugin({ + extractComments: { + filename: 'licenses.txt', + }, + }).apply(compiler); + + const stats = await compile(compiler); + + if (getCompiler.isWebpack4()) { + expect( + Object.keys(stats.compilation.assets).filter( + (assetName) => stats.compilation.assets[assetName].emitted + ).length + ).toBe(6); + } else { + expect(stats.compilation.emittedAssets.size).toBe(6); + } + + expect(readsAssets(compiler, stats)).toMatchSnapshot('assets'); + expect(getWarnings(stats)).toMatchSnapshot('errors'); + expect(getErrors(stats)).toMatchSnapshot('warnings'); + + new ModifyExistingAsset({ name: 'two.js', comment: true }).apply(compiler); + + await new Promise(async (resolve) => { + const newStats = await compile(compiler); + + if (getCompiler.isWebpack4()) { + expect( + Object.keys(newStats.compilation.assets).filter( + (assetName) => newStats.compilation.assets[assetName].emitted + ).length + ).toBe(2); + } else { + expect(newStats.compilation.emittedAssets.size).toBe(2); + } + + expect(readsAssets(compiler, stats)).toMatchSnapshot('assets'); + expect(getWarnings(newStats)).toMatchSnapshot('errors'); + expect(getErrors(newStats)).toMatchSnapshot('warnings'); + + resolve(); + }); + }); + + it('should work and do not use memory cache when the "cache" option is "false"', async () => { + const compiler = getCompiler({ + entry: { + js: path.resolve(__dirname, './fixtures/entry.js'), + mjs: path.resolve(__dirname, './fixtures/entry.mjs'), + importExport: path.resolve( + __dirname, + './fixtures/import-export/entry.js' + ), + AsyncImportExport: path.resolve( + __dirname, + './fixtures/async-import-export/entry.js' + ), + }, + cache: false, + output: { + path: path.resolve(__dirname, './dist'), + filename: '[name].js', + chunkFilename: '[id].[name].js', + }, + }); + + new TerserPlugin().apply(compiler); + + const stats = await compile(compiler); + + if (getCompiler.isWebpack4()) { + expect( + Object.keys(stats.compilation.assets).filter( + (assetName) => stats.compilation.assets[assetName].emitted + ).length + ).toBe(5); + } else { + expect(stats.compilation.emittedAssets.size).toBe(5); + } + + expect(readsAssets(compiler, stats)).toMatchSnapshot('assets'); + expect(getWarnings(stats)).toMatchSnapshot('errors'); + expect(getErrors(stats)).toMatchSnapshot('warnings'); + + await new Promise(async (resolve) => { + const newStats = await compile(compiler); + + if (getCompiler.isWebpack4()) { + expect( + Object.keys(newStats.compilation.assets).filter( + (assetName) => newStats.compilation.assets[assetName].emitted + ).length + ).toBe(5); + } else { + expect(newStats.compilation.emittedAssets.size).toBe(5); + } + + expect(readsAssets(compiler, stats)).toMatchSnapshot('assets'); + expect(getWarnings(newStats)).toMatchSnapshot('errors'); + expect(getErrors(newStats)).toMatchSnapshot('warnings'); + + resolve(); + }); + }); }); diff --git a/test/__snapshots__/TerserPlugin.test.js.snap.webpack4 b/test/__snapshots__/TerserPlugin.test.js.snap.webpack4 index b2107c39..d0a16369 100644 --- a/test/__snapshots__/TerserPlugin.test.js.snap.webpack4 +++ b/test/__snapshots__/TerserPlugin.test.js.snap.webpack4 @@ -98,6 +98,34 @@ exports[`TerserPlugin should work (without options): errors 1`] = `Array []`; exports[`TerserPlugin should work (without options): warnings 1`] = `Array []`; +exports[`TerserPlugin should work and do not use memory cache when the "cache" option is "false": assets 1`] = ` +Object { + "4.4.js": "(window.webpackJsonp=window.webpackJsonp||[]).push([[4],{4:function(n,p,s){\\"use strict\\";s.r(p),p.default=\\"async-dep\\"}}]);", + "AsyncImportExport.js": "!function(e){function t(t){for(var r,o,u=t[0],i=t[1],a=0,l=[];a{console.log(\\"Good\\")}),t.default=\\"Awesome\\"}});", + "importExport.js": "!function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){\\"undefined\\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:\\"Module\\"}),Object.defineProperty(e,\\"__esModule\\",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&\\"object\\"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,\\"default\\",{enumerable:!0,value:e}),2&t&&\\"string\\"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,\\"a\\",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p=\\"\\",r(r.s=3)}({3:function(e,t,r){\\"use strict\\";r.r(t);t.default=function(){const e=\\"baz\\"+Math.random();return()=>({a:\\"foobar\\"+e,b:\\"foo\\",baz:e})}}});", + "js.js": "!function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){\\"undefined\\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:\\"Module\\"}),Object.defineProperty(e,\\"__esModule\\",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&\\"object\\"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,\\"default\\",{enumerable:!0,value:e}),2&t&&\\"string\\"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,\\"a\\",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p=\\"\\",n(n.s=0)}([function(e,t){e.exports=function(){console.log(7)}}]);", + "mjs.js": "!function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){\\"undefined\\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:\\"Module\\"}),Object.defineProperty(e,\\"__esModule\\",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&\\"object\\"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,\\"default\\",{enumerable:!0,value:e}),2&t&&\\"string\\"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,\\"a\\",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p=\\"\\",r(r.s=1)}([,function(e,t,r){\\"use strict\\";r.r(t);module.exports=function(){console.log(7)}}]);", +} +`; + +exports[`TerserPlugin should work and do not use memory cache when the "cache" option is "false": assets 2`] = ` +Object { + "4.4.js": "(window.webpackJsonp=window.webpackJsonp||[]).push([[4],{4:function(n,p,s){\\"use strict\\";s.r(p),p.default=\\"async-dep\\"}}]);", + "AsyncImportExport.js": "!function(e){function t(t){for(var r,o,u=t[0],i=t[1],a=0,l=[];a{console.log(\\"Good\\")}),t.default=\\"Awesome\\"}});", + "importExport.js": "!function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){\\"undefined\\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:\\"Module\\"}),Object.defineProperty(e,\\"__esModule\\",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&\\"object\\"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,\\"default\\",{enumerable:!0,value:e}),2&t&&\\"string\\"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,\\"a\\",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p=\\"\\",r(r.s=3)}({3:function(e,t,r){\\"use strict\\";r.r(t);t.default=function(){const e=\\"baz\\"+Math.random();return()=>({a:\\"foobar\\"+e,b:\\"foo\\",baz:e})}}});", + "js.js": "!function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){\\"undefined\\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:\\"Module\\"}),Object.defineProperty(e,\\"__esModule\\",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&\\"object\\"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,\\"default\\",{enumerable:!0,value:e}),2&t&&\\"string\\"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,\\"a\\",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p=\\"\\",n(n.s=0)}([function(e,t){e.exports=function(){console.log(7)}}]);", + "mjs.js": "!function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){\\"undefined\\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:\\"Module\\"}),Object.defineProperty(e,\\"__esModule\\",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&\\"object\\"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,\\"default\\",{enumerable:!0,value:e}),2&t&&\\"string\\"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,\\"a\\",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p=\\"\\",r(r.s=1)}([,function(e,t,r){\\"use strict\\";r.r(t);module.exports=function(){console.log(7)}}]);", +} +`; + +exports[`TerserPlugin should work and do not use memory cache when the "cache" option is "false": errors 1`] = `Array []`; + +exports[`TerserPlugin should work and do not use memory cache when the "cache" option is "false": errors 2`] = `Array []`; + +exports[`TerserPlugin should work and do not use memory cache when the "cache" option is "false": warnings 1`] = `Array []`; + +exports[`TerserPlugin should work and do not use memory cache when the "cache" option is "false": warnings 2`] = `Array []`; + exports[`TerserPlugin should work and respect "terser" errors (the "parallel" option is "false"): errors 1`] = ` Array [ "Error: main.js from Terser @@ -144,6 +172,62 @@ exports[`TerserPlugin should work and show related assets in stats: errors 1`] = exports[`TerserPlugin should work and show related assets in stats: warnings 1`] = `Array []`; +exports[`TerserPlugin should work and use memory cache when the "cache" option is "true" and the asset has been changed: assets 1`] = ` +Object { + "4.4.js": "(window.webpackJsonp=window.webpackJsonp||[]).push([[4],{4:function(n,p,s){\\"use strict\\";s.r(p),p.default=\\"async-dep\\"}}]);", + "AsyncImportExport.js": "!function(e){function t(t){for(var r,o,u=t[0],i=t[1],a=0,l=[];a{console.log(\\"Good\\")}),t.default=\\"Awesome\\"}});", + "importExport.js": "!function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){\\"undefined\\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:\\"Module\\"}),Object.defineProperty(e,\\"__esModule\\",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&\\"object\\"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,\\"default\\",{enumerable:!0,value:e}),2&t&&\\"string\\"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,\\"a\\",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p=\\"\\",r(r.s=3)}({3:function(e,t,r){\\"use strict\\";r.r(t);t.default=function(){const e=\\"baz\\"+Math.random();return()=>({a:\\"foobar\\"+e,b:\\"foo\\",baz:e})}}});", + "js.js": "!function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){\\"undefined\\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:\\"Module\\"}),Object.defineProperty(e,\\"__esModule\\",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&\\"object\\"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,\\"default\\",{enumerable:!0,value:e}),2&t&&\\"string\\"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,\\"a\\",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p=\\"\\",n(n.s=0)}([function(e,t){e.exports=function(){console.log(7)}}]);", + "mjs.js": "!function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){\\"undefined\\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:\\"Module\\"}),Object.defineProperty(e,\\"__esModule\\",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&\\"object\\"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,\\"default\\",{enumerable:!0,value:e}),2&t&&\\"string\\"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,\\"a\\",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p=\\"\\",r(r.s=1)}([,function(e,t,r){\\"use strict\\";r.r(t);module.exports=function(){console.log(7)}}]);", +} +`; + +exports[`TerserPlugin should work and use memory cache when the "cache" option is "true" and the asset has been changed: assets 2`] = ` +Object { + "4.4.js": "(window.webpackJsonp=window.webpackJsonp||[]).push([[4],{4:function(n,p,s){\\"use strict\\";s.r(p),p.default=\\"async-dep\\"}}]);", + "AsyncImportExport.js": "!function(e){function t(t){for(var r,o,u=t[0],i=t[1],a=0,l=[];a{console.log(\\"Good\\")}),t.default=\\"Awesome\\"}});", + "importExport.js": "!function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){\\"undefined\\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:\\"Module\\"}),Object.defineProperty(e,\\"__esModule\\",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&\\"object\\"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,\\"default\\",{enumerable:!0,value:e}),2&t&&\\"string\\"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,\\"a\\",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p=\\"\\",r(r.s=3)}({3:function(e,t,r){\\"use strict\\";r.r(t);t.default=function(){const e=\\"baz\\"+Math.random();return()=>({a:\\"foobar\\"+e,b:\\"foo\\",baz:e})}}});", + "js.js": "function changed(){}!function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){\\"undefined\\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:\\"Module\\"}),Object.defineProperty(e,\\"__esModule\\",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&\\"object\\"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,\\"default\\",{enumerable:!0,value:e}),2&t&&\\"string\\"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,\\"a\\",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p=\\"\\",n(n.s=0)}([function(e,t){e.exports=function(){console.log(7)}}]);", + "mjs.js": "!function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){\\"undefined\\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:\\"Module\\"}),Object.defineProperty(e,\\"__esModule\\",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&\\"object\\"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,\\"default\\",{enumerable:!0,value:e}),2&t&&\\"string\\"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,\\"a\\",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p=\\"\\",r(r.s=1)}([,function(e,t,r){\\"use strict\\";r.r(t);module.exports=function(){console.log(7)}}]);", +} +`; + +exports[`TerserPlugin should work and use memory cache when the "cache" option is "true" and the asset has been changed: errors 1`] = `Array []`; + +exports[`TerserPlugin should work and use memory cache when the "cache" option is "true" and the asset has been changed: errors 2`] = `Array []`; + +exports[`TerserPlugin should work and use memory cache when the "cache" option is "true" and the asset has been changed: warnings 1`] = `Array []`; + +exports[`TerserPlugin should work and use memory cache when the "cache" option is "true" and the asset has been changed: warnings 2`] = `Array []`; + +exports[`TerserPlugin should work and use memory cache when the "cache" option is "true": assets 1`] = ` +Object { + "4.4.js": "(window.webpackJsonp=window.webpackJsonp||[]).push([[4],{4:function(n,p,s){\\"use strict\\";s.r(p),p.default=\\"async-dep\\"}}]);", + "AsyncImportExport.js": "!function(e){function t(t){for(var r,o,u=t[0],i=t[1],a=0,l=[];a{console.log(\\"Good\\")}),t.default=\\"Awesome\\"}});", + "importExport.js": "!function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){\\"undefined\\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:\\"Module\\"}),Object.defineProperty(e,\\"__esModule\\",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&\\"object\\"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,\\"default\\",{enumerable:!0,value:e}),2&t&&\\"string\\"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,\\"a\\",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p=\\"\\",r(r.s=3)}({3:function(e,t,r){\\"use strict\\";r.r(t);t.default=function(){const e=\\"baz\\"+Math.random();return()=>({a:\\"foobar\\"+e,b:\\"foo\\",baz:e})}}});", + "js.js": "!function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){\\"undefined\\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:\\"Module\\"}),Object.defineProperty(e,\\"__esModule\\",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&\\"object\\"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,\\"default\\",{enumerable:!0,value:e}),2&t&&\\"string\\"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,\\"a\\",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p=\\"\\",n(n.s=0)}([function(e,t){e.exports=function(){console.log(7)}}]);", + "mjs.js": "!function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){\\"undefined\\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:\\"Module\\"}),Object.defineProperty(e,\\"__esModule\\",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&\\"object\\"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,\\"default\\",{enumerable:!0,value:e}),2&t&&\\"string\\"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,\\"a\\",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p=\\"\\",r(r.s=1)}([,function(e,t,r){\\"use strict\\";r.r(t);module.exports=function(){console.log(7)}}]);", +} +`; + +exports[`TerserPlugin should work and use memory cache when the "cache" option is "true": assets 2`] = ` +Object { + "4.4.js": "(window.webpackJsonp=window.webpackJsonp||[]).push([[4],{4:function(n,p,s){\\"use strict\\";s.r(p),p.default=\\"async-dep\\"}}]);", + "AsyncImportExport.js": "!function(e){function t(t){for(var r,o,u=t[0],i=t[1],a=0,l=[];a{console.log(\\"Good\\")}),t.default=\\"Awesome\\"}});", + "importExport.js": "!function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){\\"undefined\\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:\\"Module\\"}),Object.defineProperty(e,\\"__esModule\\",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&\\"object\\"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,\\"default\\",{enumerable:!0,value:e}),2&t&&\\"string\\"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,\\"a\\",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p=\\"\\",r(r.s=3)}({3:function(e,t,r){\\"use strict\\";r.r(t);t.default=function(){const e=\\"baz\\"+Math.random();return()=>({a:\\"foobar\\"+e,b:\\"foo\\",baz:e})}}});", + "js.js": "!function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){\\"undefined\\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:\\"Module\\"}),Object.defineProperty(e,\\"__esModule\\",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&\\"object\\"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,\\"default\\",{enumerable:!0,value:e}),2&t&&\\"string\\"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,\\"a\\",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p=\\"\\",n(n.s=0)}([function(e,t){e.exports=function(){console.log(7)}}]);", + "mjs.js": "!function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){\\"undefined\\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:\\"Module\\"}),Object.defineProperty(e,\\"__esModule\\",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&\\"object\\"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,\\"default\\",{enumerable:!0,value:e}),2&t&&\\"string\\"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,\\"a\\",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p=\\"\\",r(r.s=1)}([,function(e,t,r){\\"use strict\\";r.r(t);module.exports=function(){console.log(7)}}]);", +} +`; + +exports[`TerserPlugin should work and use memory cache when the "cache" option is "true": errors 1`] = `Array []`; + +exports[`TerserPlugin should work and use memory cache when the "cache" option is "true": errors 2`] = `Array []`; + +exports[`TerserPlugin should work and use memory cache when the "cache" option is "true": warnings 1`] = `Array []`; + +exports[`TerserPlugin should work and use memory cache when the "cache" option is "true": warnings 2`] = `Array []`; + exports[`TerserPlugin should work as a minimizer: assets 1`] = ` Object { "main.js": "!function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){\\"undefined\\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:\\"Module\\"}),Object.defineProperty(e,\\"__esModule\\",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&\\"object\\"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,\\"default\\",{enumerable:!0,value:e}),2&t&&\\"string\\"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,\\"a\\",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p=\\"\\",n(n.s=0)}([function(e,t){e.exports=function(){console.log(7)}}]);", @@ -598,6 +682,578 @@ exports[`TerserPlugin should work with child compilation: errors 1`] = `Array [] exports[`TerserPlugin should work with child compilation: warnings 1`] = `Array []`; +exports[`TerserPlugin should work with source map and use memory cache when the "cache" option is "true" and the asset has been changed: assets 1`] = ` +Object { + "4.4.js": "(window.webpackJsonp=window.webpackJsonp||[]).push([[4],{4:function(n,p,s){\\"use strict\\";s.r(p),p.default=\\"async-dep\\"}}]); +//# sourceMappingURL=4.4.js.map", + "4.4.js.map": "{\\"version\\":3,\\"sources\\":[\\"webpack:///./test/fixtures/async-import-export/async-dep.js\\"],\\"names\\":[],\\"mappings\\":\\"wFAAA,OAAe\\",\\"file\\":\\"4.4.js\\",\\"sourcesContent\\":[\\"export default \\\\\\"async-dep\\\\\\";\\\\n\\"],\\"sourceRoot\\":\\"\\"}", + "AsyncImportExport.js": "!function(e){function t(t){for(var r,o,u=t[0],i=t[1],a=0,l=[];a{console.log(\\"Good\\")}),t.default=\\"Awesome\\"}}); +//# sourceMappingURL=AsyncImportExport.js.map", + "AsyncImportExport.js.map": "{\\"version\\":3,\\"sources\\":[\\"webpack:///webpack/bootstrap\\",\\"webpack:///./test/fixtures/async-import-export/entry.js\\"],\\"names\\":[\\"webpackJsonpCallback\\",\\"data\\",\\"moduleId\\",\\"chunkId\\",\\"chunkIds\\",\\"moreModules\\",\\"i\\",\\"resolves\\",\\"length\\",\\"Object\\",\\"prototype\\",\\"hasOwnProperty\\",\\"call\\",\\"installedChunks\\",\\"push\\",\\"modules\\",\\"parentJsonpFunction\\",\\"shift\\",\\"installedModules\\",\\"0\\",\\"__webpack_require__\\",\\"exports\\",\\"module\\",\\"l\\",\\"e\\",\\"promises\\",\\"installedChunkData\\",\\"promise\\",\\"Promise\\",\\"resolve\\",\\"reject\\",\\"onScriptComplete\\",\\"script\\",\\"document\\",\\"createElement\\",\\"charset\\",\\"timeout\\",\\"nc\\",\\"setAttribute\\",\\"src\\",\\"p\\",\\"jsonpScriptSrc\\",\\"error\\",\\"Error\\",\\"event\\",\\"onerror\\",\\"onload\\",\\"clearTimeout\\",\\"chunk\\",\\"errorType\\",\\"type\\",\\"realSrc\\",\\"target\\",\\"message\\",\\"name\\",\\"request\\",\\"undefined\\",\\"setTimeout\\",\\"head\\",\\"appendChild\\",\\"all\\",\\"m\\",\\"c\\",\\"d\\",\\"getter\\",\\"o\\",\\"defineProperty\\",\\"enumerable\\",\\"get\\",\\"r\\",\\"Symbol\\",\\"toStringTag\\",\\"value\\",\\"t\\",\\"mode\\",\\"__esModule\\",\\"ns\\",\\"create\\",\\"key\\",\\"bind\\",\\"n\\",\\"object\\",\\"property\\",\\"oe\\",\\"err\\",\\"console\\",\\"jsonpArray\\",\\"window\\",\\"oldJsonpFunction\\",\\"slice\\",\\"s\\",\\"then\\",\\"log\\"],\\"mappings\\":\\"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\\",\\"file\\":\\"AsyncImportExport.js\\",\\"sourcesContent\\":[\\" \\\\t// install a JSONP callback for chunk loading\\\\n \\\\tfunction webpackJsonpCallback(data) {\\\\n \\\\t\\\\tvar chunkIds = data[0];\\\\n \\\\t\\\\tvar moreModules = data[1];\\\\n\\\\n\\\\n \\\\t\\\\t// add \\\\\\"moreModules\\\\\\" to the modules object,\\\\n \\\\t\\\\t// then flag all \\\\\\"chunkIds\\\\\\" as loaded and fire callback\\\\n \\\\t\\\\tvar moduleId, chunkId, i = 0, resolves = [];\\\\n \\\\t\\\\tfor(;i < chunkIds.length; i++) {\\\\n \\\\t\\\\t\\\\tchunkId = chunkIds[i];\\\\n \\\\t\\\\t\\\\tif(Object.prototype.hasOwnProperty.call(installedChunks, chunkId) && installedChunks[chunkId]) {\\\\n \\\\t\\\\t\\\\t\\\\tresolves.push(installedChunks[chunkId][0]);\\\\n \\\\t\\\\t\\\\t}\\\\n \\\\t\\\\t\\\\tinstalledChunks[chunkId] = 0;\\\\n \\\\t\\\\t}\\\\n \\\\t\\\\tfor(moduleId in moreModules) {\\\\n \\\\t\\\\t\\\\tif(Object.prototype.hasOwnProperty.call(moreModules, moduleId)) {\\\\n \\\\t\\\\t\\\\t\\\\tmodules[moduleId] = moreModules[moduleId];\\\\n \\\\t\\\\t\\\\t}\\\\n \\\\t\\\\t}\\\\n \\\\t\\\\tif(parentJsonpFunction) parentJsonpFunction(data);\\\\n\\\\n \\\\t\\\\twhile(resolves.length) {\\\\n \\\\t\\\\t\\\\tresolves.shift()();\\\\n \\\\t\\\\t}\\\\n\\\\n \\\\t};\\\\n\\\\n\\\\n \\\\t// The module cache\\\\n \\\\tvar installedModules = {};\\\\n\\\\n \\\\t// object to store loaded and loading chunks\\\\n \\\\t// undefined = chunk not loaded, null = chunk preloaded/prefetched\\\\n \\\\t// Promise = chunk loading, 0 = chunk loaded\\\\n \\\\tvar installedChunks = {\\\\n \\\\t\\\\t0: 0\\\\n \\\\t};\\\\n\\\\n\\\\n\\\\n \\\\t// script path function\\\\n \\\\tfunction jsonpScriptSrc(chunkId) {\\\\n \\\\t\\\\treturn __webpack_require__.p + \\\\\\"\\\\\\" + chunkId + \\\\\\".\\\\\\" + ({}[chunkId]||chunkId) + \\\\\\".js\\\\\\"\\\\n \\\\t}\\\\n\\\\n \\\\t// The require function\\\\n \\\\tfunction __webpack_require__(moduleId) {\\\\n\\\\n \\\\t\\\\t// Check if module is in cache\\\\n \\\\t\\\\tif(installedModules[moduleId]) {\\\\n \\\\t\\\\t\\\\treturn installedModules[moduleId].exports;\\\\n \\\\t\\\\t}\\\\n \\\\t\\\\t// Create a new module (and put it into the cache)\\\\n \\\\t\\\\tvar module = installedModules[moduleId] = {\\\\n \\\\t\\\\t\\\\ti: moduleId,\\\\n \\\\t\\\\t\\\\tl: false,\\\\n \\\\t\\\\t\\\\texports: {}\\\\n \\\\t\\\\t};\\\\n\\\\n \\\\t\\\\t// Execute the module function\\\\n \\\\t\\\\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\\\\n\\\\n \\\\t\\\\t// Flag the module as loaded\\\\n \\\\t\\\\tmodule.l = true;\\\\n\\\\n \\\\t\\\\t// Return the exports of the module\\\\n \\\\t\\\\treturn module.exports;\\\\n \\\\t}\\\\n\\\\n \\\\t// This file contains only the entry chunk.\\\\n \\\\t// The chunk loading function for additional chunks\\\\n \\\\t__webpack_require__.e = function requireEnsure(chunkId) {\\\\n \\\\t\\\\tvar promises = [];\\\\n\\\\n\\\\n \\\\t\\\\t// JSONP chunk loading for javascript\\\\n\\\\n \\\\t\\\\tvar installedChunkData = installedChunks[chunkId];\\\\n \\\\t\\\\tif(installedChunkData !== 0) { // 0 means \\\\\\"already installed\\\\\\".\\\\n\\\\n \\\\t\\\\t\\\\t// a Promise means \\\\\\"currently loading\\\\\\".\\\\n \\\\t\\\\t\\\\tif(installedChunkData) {\\\\n \\\\t\\\\t\\\\t\\\\tpromises.push(installedChunkData[2]);\\\\n \\\\t\\\\t\\\\t} else {\\\\n \\\\t\\\\t\\\\t\\\\t// setup Promise in chunk cache\\\\n \\\\t\\\\t\\\\t\\\\tvar promise = new Promise(function(resolve, reject) {\\\\n \\\\t\\\\t\\\\t\\\\t\\\\tinstalledChunkData = installedChunks[chunkId] = [resolve, reject];\\\\n \\\\t\\\\t\\\\t\\\\t});\\\\n \\\\t\\\\t\\\\t\\\\tpromises.push(installedChunkData[2] = promise);\\\\n\\\\n \\\\t\\\\t\\\\t\\\\t// start chunk loading\\\\n \\\\t\\\\t\\\\t\\\\tvar script = document.createElement('script');\\\\n \\\\t\\\\t\\\\t\\\\tvar onScriptComplete;\\\\n\\\\n \\\\t\\\\t\\\\t\\\\tscript.charset = 'utf-8';\\\\n \\\\t\\\\t\\\\t\\\\tscript.timeout = 120;\\\\n \\\\t\\\\t\\\\t\\\\tif (__webpack_require__.nc) {\\\\n \\\\t\\\\t\\\\t\\\\t\\\\tscript.setAttribute(\\\\\\"nonce\\\\\\", __webpack_require__.nc);\\\\n \\\\t\\\\t\\\\t\\\\t}\\\\n \\\\t\\\\t\\\\t\\\\tscript.src = jsonpScriptSrc(chunkId);\\\\n\\\\n \\\\t\\\\t\\\\t\\\\t// create error before stack unwound to get useful stacktrace later\\\\n \\\\t\\\\t\\\\t\\\\tvar error = new Error();\\\\n \\\\t\\\\t\\\\t\\\\tonScriptComplete = function (event) {\\\\n \\\\t\\\\t\\\\t\\\\t\\\\t// avoid mem leaks in IE.\\\\n \\\\t\\\\t\\\\t\\\\t\\\\tscript.onerror = script.onload = null;\\\\n \\\\t\\\\t\\\\t\\\\t\\\\tclearTimeout(timeout);\\\\n \\\\t\\\\t\\\\t\\\\t\\\\tvar chunk = installedChunks[chunkId];\\\\n \\\\t\\\\t\\\\t\\\\t\\\\tif(chunk !== 0) {\\\\n \\\\t\\\\t\\\\t\\\\t\\\\t\\\\tif(chunk) {\\\\n \\\\t\\\\t\\\\t\\\\t\\\\t\\\\t\\\\tvar errorType = event && (event.type === 'load' ? 'missing' : event.type);\\\\n \\\\t\\\\t\\\\t\\\\t\\\\t\\\\t\\\\tvar realSrc = event && event.target && event.target.src;\\\\n \\\\t\\\\t\\\\t\\\\t\\\\t\\\\t\\\\terror.message = 'Loading chunk ' + chunkId + ' failed.\\\\\\\\n(' + errorType + ': ' + realSrc + ')';\\\\n \\\\t\\\\t\\\\t\\\\t\\\\t\\\\t\\\\terror.name = 'ChunkLoadError';\\\\n \\\\t\\\\t\\\\t\\\\t\\\\t\\\\t\\\\terror.type = errorType;\\\\n \\\\t\\\\t\\\\t\\\\t\\\\t\\\\t\\\\terror.request = realSrc;\\\\n \\\\t\\\\t\\\\t\\\\t\\\\t\\\\t\\\\tchunk[1](error);\\\\n \\\\t\\\\t\\\\t\\\\t\\\\t\\\\t}\\\\n \\\\t\\\\t\\\\t\\\\t\\\\t\\\\tinstalledChunks[chunkId] = undefined;\\\\n \\\\t\\\\t\\\\t\\\\t\\\\t}\\\\n \\\\t\\\\t\\\\t\\\\t};\\\\n \\\\t\\\\t\\\\t\\\\tvar timeout = setTimeout(function(){\\\\n \\\\t\\\\t\\\\t\\\\t\\\\tonScriptComplete({ type: 'timeout', target: script });\\\\n \\\\t\\\\t\\\\t\\\\t}, 120000);\\\\n \\\\t\\\\t\\\\t\\\\tscript.onerror = script.onload = onScriptComplete;\\\\n \\\\t\\\\t\\\\t\\\\tdocument.head.appendChild(script);\\\\n \\\\t\\\\t\\\\t}\\\\n \\\\t\\\\t}\\\\n \\\\t\\\\treturn Promise.all(promises);\\\\n \\\\t};\\\\n\\\\n \\\\t// expose the modules object (__webpack_modules__)\\\\n \\\\t__webpack_require__.m = modules;\\\\n\\\\n \\\\t// expose the module cache\\\\n \\\\t__webpack_require__.c = installedModules;\\\\n\\\\n \\\\t// define getter function for harmony exports\\\\n \\\\t__webpack_require__.d = function(exports, name, getter) {\\\\n \\\\t\\\\tif(!__webpack_require__.o(exports, name)) {\\\\n \\\\t\\\\t\\\\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\\\\n \\\\t\\\\t}\\\\n \\\\t};\\\\n\\\\n \\\\t// define __esModule on exports\\\\n \\\\t__webpack_require__.r = function(exports) {\\\\n \\\\t\\\\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\\\\n \\\\t\\\\t\\\\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\\\\n \\\\t\\\\t}\\\\n \\\\t\\\\tObject.defineProperty(exports, '__esModule', { value: true });\\\\n \\\\t};\\\\n\\\\n \\\\t// create a fake namespace object\\\\n \\\\t// mode & 1: value is a module id, require it\\\\n \\\\t// mode & 2: merge all properties of value into the ns\\\\n \\\\t// mode & 4: return value when already ns object\\\\n \\\\t// mode & 8|1: behave like require\\\\n \\\\t__webpack_require__.t = function(value, mode) {\\\\n \\\\t\\\\tif(mode & 1) value = __webpack_require__(value);\\\\n \\\\t\\\\tif(mode & 8) return value;\\\\n \\\\t\\\\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\\\\n \\\\t\\\\tvar ns = Object.create(null);\\\\n \\\\t\\\\t__webpack_require__.r(ns);\\\\n \\\\t\\\\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\\\\n \\\\t\\\\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\\\\n \\\\t\\\\treturn ns;\\\\n \\\\t};\\\\n\\\\n \\\\t// getDefaultExport function for compatibility with non-harmony modules\\\\n \\\\t__webpack_require__.n = function(module) {\\\\n \\\\t\\\\tvar getter = module && module.__esModule ?\\\\n \\\\t\\\\t\\\\tfunction getDefault() { return module['default']; } :\\\\n \\\\t\\\\t\\\\tfunction getModuleExports() { return module; };\\\\n \\\\t\\\\t__webpack_require__.d(getter, 'a', getter);\\\\n \\\\t\\\\treturn getter;\\\\n \\\\t};\\\\n\\\\n \\\\t// Object.prototype.hasOwnProperty.call\\\\n \\\\t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\\\\n\\\\n \\\\t// __webpack_public_path__\\\\n \\\\t__webpack_require__.p = \\\\\\"\\\\\\";\\\\n\\\\n \\\\t// on error function for async loading\\\\n \\\\t__webpack_require__.oe = function(err) { console.error(err); throw err; };\\\\n\\\\n \\\\tvar jsonpArray = window[\\\\\\"webpackJsonp\\\\\\"] = window[\\\\\\"webpackJsonp\\\\\\"] || [];\\\\n \\\\tvar oldJsonpFunction = jsonpArray.push.bind(jsonpArray);\\\\n \\\\tjsonpArray.push = webpackJsonpCallback;\\\\n \\\\tjsonpArray = jsonpArray.slice();\\\\n \\\\tfor(var i = 0; i < jsonpArray.length; i++) webpackJsonpCallback(jsonpArray[i]);\\\\n \\\\tvar parentJsonpFunction = oldJsonpFunction;\\\\n\\\\n\\\\n \\\\t// Load entry module and return exports\\\\n \\\\treturn __webpack_require__(__webpack_require__.s = 2);\\\\n\\",\\"import(\\\\\\"./async-dep\\\\\\").then(() => {\\\\n console.log('Good')\\\\n});\\\\n\\\\nexport default \\\\\\"Awesome\\\\\\";\\\\n\\"],\\"sourceRoot\\":\\"\\"}", + "importExport.js": "!function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){\\"undefined\\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:\\"Module\\"}),Object.defineProperty(e,\\"__esModule\\",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&\\"object\\"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,\\"default\\",{enumerable:!0,value:e}),2&t&&\\"string\\"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,\\"a\\",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p=\\"\\",r(r.s=3)}({3:function(e,t,r){\\"use strict\\";r.r(t);t.default=function(){const e=\\"baz\\"+Math.random();return()=>({a:\\"foobar\\"+e,b:\\"foo\\",baz:e})}}}); +//# sourceMappingURL=importExport.js.map", + "importExport.js.map": "{\\"version\\":3,\\"sources\\":[\\"webpack:///webpack/bootstrap\\",\\"webpack:///./test/fixtures/import-export/entry.js\\",\\"webpack:///./test/fixtures/import-export/dep.js\\"],\\"names\\":[\\"installedModules\\",\\"__webpack_require__\\",\\"moduleId\\",\\"exports\\",\\"module\\",\\"i\\",\\"l\\",\\"modules\\",\\"call\\",\\"m\\",\\"c\\",\\"d\\",\\"name\\",\\"getter\\",\\"o\\",\\"Object\\",\\"defineProperty\\",\\"enumerable\\",\\"get\\",\\"r\\",\\"Symbol\\",\\"toStringTag\\",\\"value\\",\\"t\\",\\"mode\\",\\"__esModule\\",\\"ns\\",\\"create\\",\\"key\\",\\"bind\\",\\"n\\",\\"object\\",\\"property\\",\\"prototype\\",\\"hasOwnProperty\\",\\"p\\",\\"s\\",\\"baz\\",\\"Math\\",\\"random\\",\\"a\\",\\"b\\"],\\"mappings\\":\\"aACE,IAAIA,EAAmB,GAGvB,SAASC,EAAoBC,GAG5B,GAAGF,EAAiBE,GACnB,OAAOF,EAAiBE,GAAUC,QAGnC,IAAIC,EAASJ,EAAiBE,GAAY,CACzCG,EAAGH,EACHI,GAAG,EACHH,QAAS,IAUV,OANAI,EAAQL,GAAUM,KAAKJ,EAAOD,QAASC,EAAQA,EAAOD,QAASF,GAG/DG,EAAOE,GAAI,EAGJF,EAAOD,QAKfF,EAAoBQ,EAAIF,EAGxBN,EAAoBS,EAAIV,EAGxBC,EAAoBU,EAAI,SAASR,EAASS,EAAMC,GAC3CZ,EAAoBa,EAAEX,EAASS,IAClCG,OAAOC,eAAeb,EAASS,EAAM,CAAEK,YAAY,EAAMC,IAAKL,KAKhEZ,EAAoBkB,EAAI,SAAShB,GACX,oBAAXiB,QAA0BA,OAAOC,aAC1CN,OAAOC,eAAeb,EAASiB,OAAOC,YAAa,CAAEC,MAAO,WAE7DP,OAAOC,eAAeb,EAAS,aAAc,CAAEmB,OAAO,KAQvDrB,EAAoBsB,EAAI,SAASD,EAAOE,GAEvC,GADU,EAAPA,IAAUF,EAAQrB,EAAoBqB,IAC/B,EAAPE,EAAU,OAAOF,EACpB,GAAW,EAAPE,GAA8B,iBAAVF,GAAsBA,GAASA,EAAMG,WAAY,OAAOH,EAChF,IAAII,EAAKX,OAAOY,OAAO,MAGvB,GAFA1B,EAAoBkB,EAAEO,GACtBX,OAAOC,eAAeU,EAAI,UAAW,CAAET,YAAY,EAAMK,MAAOA,IACtD,EAAPE,GAA4B,iBAATF,EAAmB,IAAI,IAAIM,KAAON,EAAOrB,EAAoBU,EAAEe,EAAIE,EAAK,SAASA,GAAO,OAAON,EAAMM,IAAQC,KAAK,KAAMD,IAC9I,OAAOF,GAIRzB,EAAoB6B,EAAI,SAAS1B,GAChC,IAAIS,EAAST,GAAUA,EAAOqB,WAC7B,WAAwB,OAAOrB,EAAgB,SAC/C,WAA8B,OAAOA,GAEtC,OADAH,EAAoBU,EAAEE,EAAQ,IAAKA,GAC5BA,GAIRZ,EAAoBa,EAAI,SAASiB,EAAQC,GAAY,OAAOjB,OAAOkB,UAAUC,eAAe1B,KAAKuB,EAAQC,IAGzG/B,EAAoBkC,EAAI,GAIjBlC,EAAoBA,EAAoBmC,EAAI,G,wCCpEtC,UAZf,WACE,MACMC,EAAM,MAAMC,KAAKC,SACvB,MAAO,KACE,CACLC,EAAGC,SAAUJ,EACbI,ECPS,MDQTJ\\",\\"file\\":\\"importExport.js\\",\\"sourcesContent\\":[\\" \\\\t// The module cache\\\\n \\\\tvar installedModules = {};\\\\n\\\\n \\\\t// The require function\\\\n \\\\tfunction __webpack_require__(moduleId) {\\\\n\\\\n \\\\t\\\\t// Check if module is in cache\\\\n \\\\t\\\\tif(installedModules[moduleId]) {\\\\n \\\\t\\\\t\\\\treturn installedModules[moduleId].exports;\\\\n \\\\t\\\\t}\\\\n \\\\t\\\\t// Create a new module (and put it into the cache)\\\\n \\\\t\\\\tvar module = installedModules[moduleId] = {\\\\n \\\\t\\\\t\\\\ti: moduleId,\\\\n \\\\t\\\\t\\\\tl: false,\\\\n \\\\t\\\\t\\\\texports: {}\\\\n \\\\t\\\\t};\\\\n\\\\n \\\\t\\\\t// Execute the module function\\\\n \\\\t\\\\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\\\\n\\\\n \\\\t\\\\t// Flag the module as loaded\\\\n \\\\t\\\\tmodule.l = true;\\\\n\\\\n \\\\t\\\\t// Return the exports of the module\\\\n \\\\t\\\\treturn module.exports;\\\\n \\\\t}\\\\n\\\\n\\\\n \\\\t// expose the modules object (__webpack_modules__)\\\\n \\\\t__webpack_require__.m = modules;\\\\n\\\\n \\\\t// expose the module cache\\\\n \\\\t__webpack_require__.c = installedModules;\\\\n\\\\n \\\\t// define getter function for harmony exports\\\\n \\\\t__webpack_require__.d = function(exports, name, getter) {\\\\n \\\\t\\\\tif(!__webpack_require__.o(exports, name)) {\\\\n \\\\t\\\\t\\\\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\\\\n \\\\t\\\\t}\\\\n \\\\t};\\\\n\\\\n \\\\t// define __esModule on exports\\\\n \\\\t__webpack_require__.r = function(exports) {\\\\n \\\\t\\\\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\\\\n \\\\t\\\\t\\\\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\\\\n \\\\t\\\\t}\\\\n \\\\t\\\\tObject.defineProperty(exports, '__esModule', { value: true });\\\\n \\\\t};\\\\n\\\\n \\\\t// create a fake namespace object\\\\n \\\\t// mode & 1: value is a module id, require it\\\\n \\\\t// mode & 2: merge all properties of value into the ns\\\\n \\\\t// mode & 4: return value when already ns object\\\\n \\\\t// mode & 8|1: behave like require\\\\n \\\\t__webpack_require__.t = function(value, mode) {\\\\n \\\\t\\\\tif(mode & 1) value = __webpack_require__(value);\\\\n \\\\t\\\\tif(mode & 8) return value;\\\\n \\\\t\\\\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\\\\n \\\\t\\\\tvar ns = Object.create(null);\\\\n \\\\t\\\\t__webpack_require__.r(ns);\\\\n \\\\t\\\\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\\\\n \\\\t\\\\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\\\\n \\\\t\\\\treturn ns;\\\\n \\\\t};\\\\n\\\\n \\\\t// getDefaultExport function for compatibility with non-harmony modules\\\\n \\\\t__webpack_require__.n = function(module) {\\\\n \\\\t\\\\tvar getter = module && module.__esModule ?\\\\n \\\\t\\\\t\\\\tfunction getDefault() { return module['default']; } :\\\\n \\\\t\\\\t\\\\tfunction getModuleExports() { return module; };\\\\n \\\\t\\\\t__webpack_require__.d(getter, 'a', getter);\\\\n \\\\t\\\\treturn getter;\\\\n \\\\t};\\\\n\\\\n \\\\t// Object.prototype.hasOwnProperty.call\\\\n \\\\t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\\\\n\\\\n \\\\t// __webpack_public_path__\\\\n \\\\t__webpack_require__.p = \\\\\\"\\\\\\";\\\\n\\\\n\\\\n \\\\t// Load entry module and return exports\\\\n \\\\treturn __webpack_require__(__webpack_require__.s = 3);\\\\n\\",\\"import foo, { bar } from './dep';\\\\n\\\\nfunction Foo() {\\\\n const b = foo;\\\\n const baz = \`baz\${Math.random()}\`;\\\\n return () => {\\\\n return {\\\\n a: b + bar + baz,\\\\n b,\\\\n baz,\\\\n };\\\\n };\\\\n}\\\\n\\\\nexport default Foo;\\\\n\\",\\"export const bar = 'bar';\\\\nexport default 'foo';\\\\n\\"],\\"sourceRoot\\":\\"\\"}", + "js.js": "!function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){\\"undefined\\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:\\"Module\\"}),Object.defineProperty(e,\\"__esModule\\",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&\\"object\\"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,\\"default\\",{enumerable:!0,value:e}),2&t&&\\"string\\"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,\\"a\\",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p=\\"\\",n(n.s=0)}([function(e,t){e.exports=function(){console.log(7)}}]); +//# sourceMappingURL=js.js.map", + "js.js.map": "{\\"version\\":3,\\"sources\\":[\\"webpack:///webpack/bootstrap\\",\\"webpack:///./test/fixtures/entry.js\\"],\\"names\\":[\\"installedModules\\",\\"__webpack_require__\\",\\"moduleId\\",\\"exports\\",\\"module\\",\\"i\\",\\"l\\",\\"modules\\",\\"call\\",\\"m\\",\\"c\\",\\"d\\",\\"name\\",\\"getter\\",\\"o\\",\\"Object\\",\\"defineProperty\\",\\"enumerable\\",\\"get\\",\\"r\\",\\"Symbol\\",\\"toStringTag\\",\\"value\\",\\"t\\",\\"mode\\",\\"__esModule\\",\\"ns\\",\\"create\\",\\"key\\",\\"bind\\",\\"n\\",\\"object\\",\\"property\\",\\"prototype\\",\\"hasOwnProperty\\",\\"p\\",\\"s\\",\\"console\\",\\"log\\",\\"b\\"],\\"mappings\\":\\"aACE,IAAIA,EAAmB,GAGvB,SAASC,EAAoBC,GAG5B,GAAGF,EAAiBE,GACnB,OAAOF,EAAiBE,GAAUC,QAGnC,IAAIC,EAASJ,EAAiBE,GAAY,CACzCG,EAAGH,EACHI,GAAG,EACHH,QAAS,IAUV,OANAI,EAAQL,GAAUM,KAAKJ,EAAOD,QAASC,EAAQA,EAAOD,QAASF,GAG/DG,EAAOE,GAAI,EAGJF,EAAOD,QAKfF,EAAoBQ,EAAIF,EAGxBN,EAAoBS,EAAIV,EAGxBC,EAAoBU,EAAI,SAASR,EAASS,EAAMC,GAC3CZ,EAAoBa,EAAEX,EAASS,IAClCG,OAAOC,eAAeb,EAASS,EAAM,CAAEK,YAAY,EAAMC,IAAKL,KAKhEZ,EAAoBkB,EAAI,SAAShB,GACX,oBAAXiB,QAA0BA,OAAOC,aAC1CN,OAAOC,eAAeb,EAASiB,OAAOC,YAAa,CAAEC,MAAO,WAE7DP,OAAOC,eAAeb,EAAS,aAAc,CAAEmB,OAAO,KAQvDrB,EAAoBsB,EAAI,SAASD,EAAOE,GAEvC,GADU,EAAPA,IAAUF,EAAQrB,EAAoBqB,IAC/B,EAAPE,EAAU,OAAOF,EACpB,GAAW,EAAPE,GAA8B,iBAAVF,GAAsBA,GAASA,EAAMG,WAAY,OAAOH,EAChF,IAAII,EAAKX,OAAOY,OAAO,MAGvB,GAFA1B,EAAoBkB,EAAEO,GACtBX,OAAOC,eAAeU,EAAI,UAAW,CAAET,YAAY,EAAMK,MAAOA,IACtD,EAAPE,GAA4B,iBAATF,EAAmB,IAAI,IAAIM,KAAON,EAAOrB,EAAoBU,EAAEe,EAAIE,EAAK,SAASA,GAAO,OAAON,EAAMM,IAAQC,KAAK,KAAMD,IAC9I,OAAOF,GAIRzB,EAAoB6B,EAAI,SAAS1B,GAChC,IAAIS,EAAST,GAAUA,EAAOqB,WAC7B,WAAwB,OAAOrB,EAAgB,SAC/C,WAA8B,OAAOA,GAEtC,OADAH,EAAoBU,EAAEE,EAAQ,IAAKA,GAC5BA,GAIRZ,EAAoBa,EAAI,SAASiB,EAAQC,GAAY,OAAOjB,OAAOkB,UAAUC,eAAe1B,KAAKuB,EAAQC,IAGzG/B,EAAoBkC,EAAI,GAIjBlC,EAAoBA,EAAoBmC,EAAI,G,gBC7ErDhC,EAAOD,QAAU,WAEfkC,QAAQC,IAAIC\\",\\"file\\":\\"js.js\\",\\"sourcesContent\\":[\\" \\\\t// The module cache\\\\n \\\\tvar installedModules = {};\\\\n\\\\n \\\\t// The require function\\\\n \\\\tfunction __webpack_require__(moduleId) {\\\\n\\\\n \\\\t\\\\t// Check if module is in cache\\\\n \\\\t\\\\tif(installedModules[moduleId]) {\\\\n \\\\t\\\\t\\\\treturn installedModules[moduleId].exports;\\\\n \\\\t\\\\t}\\\\n \\\\t\\\\t// Create a new module (and put it into the cache)\\\\n \\\\t\\\\tvar module = installedModules[moduleId] = {\\\\n \\\\t\\\\t\\\\ti: moduleId,\\\\n \\\\t\\\\t\\\\tl: false,\\\\n \\\\t\\\\t\\\\texports: {}\\\\n \\\\t\\\\t};\\\\n\\\\n \\\\t\\\\t// Execute the module function\\\\n \\\\t\\\\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\\\\n\\\\n \\\\t\\\\t// Flag the module as loaded\\\\n \\\\t\\\\tmodule.l = true;\\\\n\\\\n \\\\t\\\\t// Return the exports of the module\\\\n \\\\t\\\\treturn module.exports;\\\\n \\\\t}\\\\n\\\\n\\\\n \\\\t// expose the modules object (__webpack_modules__)\\\\n \\\\t__webpack_require__.m = modules;\\\\n\\\\n \\\\t// expose the module cache\\\\n \\\\t__webpack_require__.c = installedModules;\\\\n\\\\n \\\\t// define getter function for harmony exports\\\\n \\\\t__webpack_require__.d = function(exports, name, getter) {\\\\n \\\\t\\\\tif(!__webpack_require__.o(exports, name)) {\\\\n \\\\t\\\\t\\\\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\\\\n \\\\t\\\\t}\\\\n \\\\t};\\\\n\\\\n \\\\t// define __esModule on exports\\\\n \\\\t__webpack_require__.r = function(exports) {\\\\n \\\\t\\\\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\\\\n \\\\t\\\\t\\\\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\\\\n \\\\t\\\\t}\\\\n \\\\t\\\\tObject.defineProperty(exports, '__esModule', { value: true });\\\\n \\\\t};\\\\n\\\\n \\\\t// create a fake namespace object\\\\n \\\\t// mode & 1: value is a module id, require it\\\\n \\\\t// mode & 2: merge all properties of value into the ns\\\\n \\\\t// mode & 4: return value when already ns object\\\\n \\\\t// mode & 8|1: behave like require\\\\n \\\\t__webpack_require__.t = function(value, mode) {\\\\n \\\\t\\\\tif(mode & 1) value = __webpack_require__(value);\\\\n \\\\t\\\\tif(mode & 8) return value;\\\\n \\\\t\\\\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\\\\n \\\\t\\\\tvar ns = Object.create(null);\\\\n \\\\t\\\\t__webpack_require__.r(ns);\\\\n \\\\t\\\\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\\\\n \\\\t\\\\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\\\\n \\\\t\\\\treturn ns;\\\\n \\\\t};\\\\n\\\\n \\\\t// getDefaultExport function for compatibility with non-harmony modules\\\\n \\\\t__webpack_require__.n = function(module) {\\\\n \\\\t\\\\tvar getter = module && module.__esModule ?\\\\n \\\\t\\\\t\\\\tfunction getDefault() { return module['default']; } :\\\\n \\\\t\\\\t\\\\tfunction getModuleExports() { return module; };\\\\n \\\\t\\\\t__webpack_require__.d(getter, 'a', getter);\\\\n \\\\t\\\\treturn getter;\\\\n \\\\t};\\\\n\\\\n \\\\t// Object.prototype.hasOwnProperty.call\\\\n \\\\t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\\\\n\\\\n \\\\t// __webpack_public_path__\\\\n \\\\t__webpack_require__.p = \\\\\\"\\\\\\";\\\\n\\\\n\\\\n \\\\t// Load entry module and return exports\\\\n \\\\treturn __webpack_require__(__webpack_require__.s = 0);\\\\n\\",\\"// foo\\\\n/* @preserve*/\\\\n// bar\\\\nconst a = 2 + 2;\\\\n\\\\nmodule.exports = function Foo() {\\\\n const b = 2 + 2;\\\\n console.log(b + 1 + 2);\\\\n};\\\\n\\"],\\"sourceRoot\\":\\"\\"}", + "mjs.js": "!function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){\\"undefined\\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:\\"Module\\"}),Object.defineProperty(e,\\"__esModule\\",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&\\"object\\"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,\\"default\\",{enumerable:!0,value:e}),2&t&&\\"string\\"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,\\"a\\",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p=\\"\\",r(r.s=1)}([,function(e,t,r){\\"use strict\\";r.r(t);module.exports=function(){console.log(7)}}]); +//# sourceMappingURL=mjs.js.map", + "mjs.js.map": "{\\"version\\":3,\\"sources\\":[\\"webpack:///webpack/bootstrap\\",\\"webpack:///./test/fixtures/entry.mjs\\"],\\"names\\":[\\"installedModules\\",\\"__webpack_require__\\",\\"moduleId\\",\\"exports\\",\\"module\\",\\"i\\",\\"l\\",\\"modules\\",\\"call\\",\\"m\\",\\"c\\",\\"d\\",\\"name\\",\\"getter\\",\\"o\\",\\"Object\\",\\"defineProperty\\",\\"enumerable\\",\\"get\\",\\"r\\",\\"Symbol\\",\\"toStringTag\\",\\"value\\",\\"t\\",\\"mode\\",\\"__esModule\\",\\"ns\\",\\"create\\",\\"key\\",\\"bind\\",\\"n\\",\\"object\\",\\"property\\",\\"prototype\\",\\"hasOwnProperty\\",\\"p\\",\\"s\\",\\"console\\",\\"log\\",\\"b\\"],\\"mappings\\":\\"aACE,IAAIA,EAAmB,GAGvB,SAASC,EAAoBC,GAG5B,GAAGF,EAAiBE,GACnB,OAAOF,EAAiBE,GAAUC,QAGnC,IAAIC,EAASJ,EAAiBE,GAAY,CACzCG,EAAGH,EACHI,GAAG,EACHH,QAAS,IAUV,OANAI,EAAQL,GAAUM,KAAKJ,EAAOD,QAASC,EAAQA,EAAOD,QAASF,GAG/DG,EAAOE,GAAI,EAGJF,EAAOD,QAKfF,EAAoBQ,EAAIF,EAGxBN,EAAoBS,EAAIV,EAGxBC,EAAoBU,EAAI,SAASR,EAASS,EAAMC,GAC3CZ,EAAoBa,EAAEX,EAASS,IAClCG,OAAOC,eAAeb,EAASS,EAAM,CAAEK,YAAY,EAAMC,IAAKL,KAKhEZ,EAAoBkB,EAAI,SAAShB,GACX,oBAAXiB,QAA0BA,OAAOC,aAC1CN,OAAOC,eAAeb,EAASiB,OAAOC,YAAa,CAAEC,MAAO,WAE7DP,OAAOC,eAAeb,EAAS,aAAc,CAAEmB,OAAO,KAQvDrB,EAAoBsB,EAAI,SAASD,EAAOE,GAEvC,GADU,EAAPA,IAAUF,EAAQrB,EAAoBqB,IAC/B,EAAPE,EAAU,OAAOF,EACpB,GAAW,EAAPE,GAA8B,iBAAVF,GAAsBA,GAASA,EAAMG,WAAY,OAAOH,EAChF,IAAII,EAAKX,OAAOY,OAAO,MAGvB,GAFA1B,EAAoBkB,EAAEO,GACtBX,OAAOC,eAAeU,EAAI,UAAW,CAAET,YAAY,EAAMK,MAAOA,IACtD,EAAPE,GAA4B,iBAATF,EAAmB,IAAI,IAAIM,KAAON,EAAOrB,EAAoBU,EAAEe,EAAIE,EAAK,SAASA,GAAO,OAAON,EAAMM,IAAQC,KAAK,KAAMD,IAC9I,OAAOF,GAIRzB,EAAoB6B,EAAI,SAAS1B,GAChC,IAAIS,EAAST,GAAUA,EAAOqB,WAC7B,WAAwB,OAAOrB,EAAgB,SAC/C,WAA8B,OAAOA,GAEtC,OADAH,EAAoBU,EAAEE,EAAQ,IAAKA,GAC5BA,GAIRZ,EAAoBa,EAAI,SAASiB,EAAQC,GAAY,OAAOjB,OAAOkB,UAAUC,eAAe1B,KAAKuB,EAAQC,IAGzG/B,EAAoBkC,EAAI,GAIjBlC,EAAoBA,EAAoBmC,EAAI,G,gCClFrD,OAKAhC,OAAOD,QAAU,WAEfkC,QAAQC,IAAIC\\",\\"file\\":\\"mjs.js\\",\\"sourcesContent\\":[\\" \\\\t// The module cache\\\\n \\\\tvar installedModules = {};\\\\n\\\\n \\\\t// The require function\\\\n \\\\tfunction __webpack_require__(moduleId) {\\\\n\\\\n \\\\t\\\\t// Check if module is in cache\\\\n \\\\t\\\\tif(installedModules[moduleId]) {\\\\n \\\\t\\\\t\\\\treturn installedModules[moduleId].exports;\\\\n \\\\t\\\\t}\\\\n \\\\t\\\\t// Create a new module (and put it into the cache)\\\\n \\\\t\\\\tvar module = installedModules[moduleId] = {\\\\n \\\\t\\\\t\\\\ti: moduleId,\\\\n \\\\t\\\\t\\\\tl: false,\\\\n \\\\t\\\\t\\\\texports: {}\\\\n \\\\t\\\\t};\\\\n\\\\n \\\\t\\\\t// Execute the module function\\\\n \\\\t\\\\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\\\\n\\\\n \\\\t\\\\t// Flag the module as loaded\\\\n \\\\t\\\\tmodule.l = true;\\\\n\\\\n \\\\t\\\\t// Return the exports of the module\\\\n \\\\t\\\\treturn module.exports;\\\\n \\\\t}\\\\n\\\\n\\\\n \\\\t// expose the modules object (__webpack_modules__)\\\\n \\\\t__webpack_require__.m = modules;\\\\n\\\\n \\\\t// expose the module cache\\\\n \\\\t__webpack_require__.c = installedModules;\\\\n\\\\n \\\\t// define getter function for harmony exports\\\\n \\\\t__webpack_require__.d = function(exports, name, getter) {\\\\n \\\\t\\\\tif(!__webpack_require__.o(exports, name)) {\\\\n \\\\t\\\\t\\\\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\\\\n \\\\t\\\\t}\\\\n \\\\t};\\\\n\\\\n \\\\t// define __esModule on exports\\\\n \\\\t__webpack_require__.r = function(exports) {\\\\n \\\\t\\\\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\\\\n \\\\t\\\\t\\\\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\\\\n \\\\t\\\\t}\\\\n \\\\t\\\\tObject.defineProperty(exports, '__esModule', { value: true });\\\\n \\\\t};\\\\n\\\\n \\\\t// create a fake namespace object\\\\n \\\\t// mode & 1: value is a module id, require it\\\\n \\\\t// mode & 2: merge all properties of value into the ns\\\\n \\\\t// mode & 4: return value when already ns object\\\\n \\\\t// mode & 8|1: behave like require\\\\n \\\\t__webpack_require__.t = function(value, mode) {\\\\n \\\\t\\\\tif(mode & 1) value = __webpack_require__(value);\\\\n \\\\t\\\\tif(mode & 8) return value;\\\\n \\\\t\\\\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\\\\n \\\\t\\\\tvar ns = Object.create(null);\\\\n \\\\t\\\\t__webpack_require__.r(ns);\\\\n \\\\t\\\\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\\\\n \\\\t\\\\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\\\\n \\\\t\\\\treturn ns;\\\\n \\\\t};\\\\n\\\\n \\\\t// getDefaultExport function for compatibility with non-harmony modules\\\\n \\\\t__webpack_require__.n = function(module) {\\\\n \\\\t\\\\tvar getter = module && module.__esModule ?\\\\n \\\\t\\\\t\\\\tfunction getDefault() { return module['default']; } :\\\\n \\\\t\\\\t\\\\tfunction getModuleExports() { return module; };\\\\n \\\\t\\\\t__webpack_require__.d(getter, 'a', getter);\\\\n \\\\t\\\\treturn getter;\\\\n \\\\t};\\\\n\\\\n \\\\t// Object.prototype.hasOwnProperty.call\\\\n \\\\t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\\\\n\\\\n \\\\t// __webpack_public_path__\\\\n \\\\t__webpack_require__.p = \\\\\\"\\\\\\";\\\\n\\\\n\\\\n \\\\t// Load entry module and return exports\\\\n \\\\treturn __webpack_require__(__webpack_require__.s = 1);\\\\n\\",\\"// foo\\\\n/* @preserve*/\\\\n// bar\\\\nconst a = 2 + 2;\\\\n\\\\nmodule.exports = function Foo() {\\\\n const b = 2 + 2;\\\\n console.log(b + 1 + 2);\\\\n};\\\\n\\"],\\"sourceRoot\\":\\"\\"}", +} +`; + +exports[`TerserPlugin should work with source map and use memory cache when the "cache" option is "true" and the asset has been changed: assets 2`] = ` +Object { + "4.4.js": "(window.webpackJsonp=window.webpackJsonp||[]).push([[4],{4:function(n,p,s){\\"use strict\\";s.r(p),p.default=\\"async-dep\\"}}]); +//# sourceMappingURL=4.4.js.map", + "4.4.js.map": "{\\"version\\":3,\\"sources\\":[\\"webpack:///./test/fixtures/async-import-export/async-dep.js\\"],\\"names\\":[],\\"mappings\\":\\"wFAAA,OAAe\\",\\"file\\":\\"4.4.js\\",\\"sourcesContent\\":[\\"export default \\\\\\"async-dep\\\\\\";\\\\n\\"],\\"sourceRoot\\":\\"\\"}", + "AsyncImportExport.js": "!function(e){function t(t){for(var r,o,u=t[0],i=t[1],a=0,l=[];a{console.log(\\"Good\\")}),t.default=\\"Awesome\\"}}); +//# sourceMappingURL=AsyncImportExport.js.map", + "AsyncImportExport.js.map": "{\\"version\\":3,\\"sources\\":[\\"webpack:///webpack/bootstrap\\",\\"webpack:///./test/fixtures/async-import-export/entry.js\\"],\\"names\\":[\\"webpackJsonpCallback\\",\\"data\\",\\"moduleId\\",\\"chunkId\\",\\"chunkIds\\",\\"moreModules\\",\\"i\\",\\"resolves\\",\\"length\\",\\"Object\\",\\"prototype\\",\\"hasOwnProperty\\",\\"call\\",\\"installedChunks\\",\\"push\\",\\"modules\\",\\"parentJsonpFunction\\",\\"shift\\",\\"installedModules\\",\\"0\\",\\"__webpack_require__\\",\\"exports\\",\\"module\\",\\"l\\",\\"e\\",\\"promises\\",\\"installedChunkData\\",\\"promise\\",\\"Promise\\",\\"resolve\\",\\"reject\\",\\"onScriptComplete\\",\\"script\\",\\"document\\",\\"createElement\\",\\"charset\\",\\"timeout\\",\\"nc\\",\\"setAttribute\\",\\"src\\",\\"p\\",\\"jsonpScriptSrc\\",\\"error\\",\\"Error\\",\\"event\\",\\"onerror\\",\\"onload\\",\\"clearTimeout\\",\\"chunk\\",\\"errorType\\",\\"type\\",\\"realSrc\\",\\"target\\",\\"message\\",\\"name\\",\\"request\\",\\"undefined\\",\\"setTimeout\\",\\"head\\",\\"appendChild\\",\\"all\\",\\"m\\",\\"c\\",\\"d\\",\\"getter\\",\\"o\\",\\"defineProperty\\",\\"enumerable\\",\\"get\\",\\"r\\",\\"Symbol\\",\\"toStringTag\\",\\"value\\",\\"t\\",\\"mode\\",\\"__esModule\\",\\"ns\\",\\"create\\",\\"key\\",\\"bind\\",\\"n\\",\\"object\\",\\"property\\",\\"oe\\",\\"err\\",\\"console\\",\\"jsonpArray\\",\\"window\\",\\"oldJsonpFunction\\",\\"slice\\",\\"s\\",\\"then\\",\\"log\\"],\\"mappings\\":\\"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\\",\\"file\\":\\"AsyncImportExport.js\\",\\"sourcesContent\\":[\\" \\\\t// install a JSONP callback for chunk loading\\\\n \\\\tfunction webpackJsonpCallback(data) {\\\\n \\\\t\\\\tvar chunkIds = data[0];\\\\n \\\\t\\\\tvar moreModules = data[1];\\\\n\\\\n\\\\n \\\\t\\\\t// add \\\\\\"moreModules\\\\\\" to the modules object,\\\\n \\\\t\\\\t// then flag all \\\\\\"chunkIds\\\\\\" as loaded and fire callback\\\\n \\\\t\\\\tvar moduleId, chunkId, i = 0, resolves = [];\\\\n \\\\t\\\\tfor(;i < chunkIds.length; i++) {\\\\n \\\\t\\\\t\\\\tchunkId = chunkIds[i];\\\\n \\\\t\\\\t\\\\tif(Object.prototype.hasOwnProperty.call(installedChunks, chunkId) && installedChunks[chunkId]) {\\\\n \\\\t\\\\t\\\\t\\\\tresolves.push(installedChunks[chunkId][0]);\\\\n \\\\t\\\\t\\\\t}\\\\n \\\\t\\\\t\\\\tinstalledChunks[chunkId] = 0;\\\\n \\\\t\\\\t}\\\\n \\\\t\\\\tfor(moduleId in moreModules) {\\\\n \\\\t\\\\t\\\\tif(Object.prototype.hasOwnProperty.call(moreModules, moduleId)) {\\\\n \\\\t\\\\t\\\\t\\\\tmodules[moduleId] = moreModules[moduleId];\\\\n \\\\t\\\\t\\\\t}\\\\n \\\\t\\\\t}\\\\n \\\\t\\\\tif(parentJsonpFunction) parentJsonpFunction(data);\\\\n\\\\n \\\\t\\\\twhile(resolves.length) {\\\\n \\\\t\\\\t\\\\tresolves.shift()();\\\\n \\\\t\\\\t}\\\\n\\\\n \\\\t};\\\\n\\\\n\\\\n \\\\t// The module cache\\\\n \\\\tvar installedModules = {};\\\\n\\\\n \\\\t// object to store loaded and loading chunks\\\\n \\\\t// undefined = chunk not loaded, null = chunk preloaded/prefetched\\\\n \\\\t// Promise = chunk loading, 0 = chunk loaded\\\\n \\\\tvar installedChunks = {\\\\n \\\\t\\\\t0: 0\\\\n \\\\t};\\\\n\\\\n\\\\n\\\\n \\\\t// script path function\\\\n \\\\tfunction jsonpScriptSrc(chunkId) {\\\\n \\\\t\\\\treturn __webpack_require__.p + \\\\\\"\\\\\\" + chunkId + \\\\\\".\\\\\\" + ({}[chunkId]||chunkId) + \\\\\\".js\\\\\\"\\\\n \\\\t}\\\\n\\\\n \\\\t// The require function\\\\n \\\\tfunction __webpack_require__(moduleId) {\\\\n\\\\n \\\\t\\\\t// Check if module is in cache\\\\n \\\\t\\\\tif(installedModules[moduleId]) {\\\\n \\\\t\\\\t\\\\treturn installedModules[moduleId].exports;\\\\n \\\\t\\\\t}\\\\n \\\\t\\\\t// Create a new module (and put it into the cache)\\\\n \\\\t\\\\tvar module = installedModules[moduleId] = {\\\\n \\\\t\\\\t\\\\ti: moduleId,\\\\n \\\\t\\\\t\\\\tl: false,\\\\n \\\\t\\\\t\\\\texports: {}\\\\n \\\\t\\\\t};\\\\n\\\\n \\\\t\\\\t// Execute the module function\\\\n \\\\t\\\\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\\\\n\\\\n \\\\t\\\\t// Flag the module as loaded\\\\n \\\\t\\\\tmodule.l = true;\\\\n\\\\n \\\\t\\\\t// Return the exports of the module\\\\n \\\\t\\\\treturn module.exports;\\\\n \\\\t}\\\\n\\\\n \\\\t// This file contains only the entry chunk.\\\\n \\\\t// The chunk loading function for additional chunks\\\\n \\\\t__webpack_require__.e = function requireEnsure(chunkId) {\\\\n \\\\t\\\\tvar promises = [];\\\\n\\\\n\\\\n \\\\t\\\\t// JSONP chunk loading for javascript\\\\n\\\\n \\\\t\\\\tvar installedChunkData = installedChunks[chunkId];\\\\n \\\\t\\\\tif(installedChunkData !== 0) { // 0 means \\\\\\"already installed\\\\\\".\\\\n\\\\n \\\\t\\\\t\\\\t// a Promise means \\\\\\"currently loading\\\\\\".\\\\n \\\\t\\\\t\\\\tif(installedChunkData) {\\\\n \\\\t\\\\t\\\\t\\\\tpromises.push(installedChunkData[2]);\\\\n \\\\t\\\\t\\\\t} else {\\\\n \\\\t\\\\t\\\\t\\\\t// setup Promise in chunk cache\\\\n \\\\t\\\\t\\\\t\\\\tvar promise = new Promise(function(resolve, reject) {\\\\n \\\\t\\\\t\\\\t\\\\t\\\\tinstalledChunkData = installedChunks[chunkId] = [resolve, reject];\\\\n \\\\t\\\\t\\\\t\\\\t});\\\\n \\\\t\\\\t\\\\t\\\\tpromises.push(installedChunkData[2] = promise);\\\\n\\\\n \\\\t\\\\t\\\\t\\\\t// start chunk loading\\\\n \\\\t\\\\t\\\\t\\\\tvar script = document.createElement('script');\\\\n \\\\t\\\\t\\\\t\\\\tvar onScriptComplete;\\\\n\\\\n \\\\t\\\\t\\\\t\\\\tscript.charset = 'utf-8';\\\\n \\\\t\\\\t\\\\t\\\\tscript.timeout = 120;\\\\n \\\\t\\\\t\\\\t\\\\tif (__webpack_require__.nc) {\\\\n \\\\t\\\\t\\\\t\\\\t\\\\tscript.setAttribute(\\\\\\"nonce\\\\\\", __webpack_require__.nc);\\\\n \\\\t\\\\t\\\\t\\\\t}\\\\n \\\\t\\\\t\\\\t\\\\tscript.src = jsonpScriptSrc(chunkId);\\\\n\\\\n \\\\t\\\\t\\\\t\\\\t// create error before stack unwound to get useful stacktrace later\\\\n \\\\t\\\\t\\\\t\\\\tvar error = new Error();\\\\n \\\\t\\\\t\\\\t\\\\tonScriptComplete = function (event) {\\\\n \\\\t\\\\t\\\\t\\\\t\\\\t// avoid mem leaks in IE.\\\\n \\\\t\\\\t\\\\t\\\\t\\\\tscript.onerror = script.onload = null;\\\\n \\\\t\\\\t\\\\t\\\\t\\\\tclearTimeout(timeout);\\\\n \\\\t\\\\t\\\\t\\\\t\\\\tvar chunk = installedChunks[chunkId];\\\\n \\\\t\\\\t\\\\t\\\\t\\\\tif(chunk !== 0) {\\\\n \\\\t\\\\t\\\\t\\\\t\\\\t\\\\tif(chunk) {\\\\n \\\\t\\\\t\\\\t\\\\t\\\\t\\\\t\\\\tvar errorType = event && (event.type === 'load' ? 'missing' : event.type);\\\\n \\\\t\\\\t\\\\t\\\\t\\\\t\\\\t\\\\tvar realSrc = event && event.target && event.target.src;\\\\n \\\\t\\\\t\\\\t\\\\t\\\\t\\\\t\\\\terror.message = 'Loading chunk ' + chunkId + ' failed.\\\\\\\\n(' + errorType + ': ' + realSrc + ')';\\\\n \\\\t\\\\t\\\\t\\\\t\\\\t\\\\t\\\\terror.name = 'ChunkLoadError';\\\\n \\\\t\\\\t\\\\t\\\\t\\\\t\\\\t\\\\terror.type = errorType;\\\\n \\\\t\\\\t\\\\t\\\\t\\\\t\\\\t\\\\terror.request = realSrc;\\\\n \\\\t\\\\t\\\\t\\\\t\\\\t\\\\t\\\\tchunk[1](error);\\\\n \\\\t\\\\t\\\\t\\\\t\\\\t\\\\t}\\\\n \\\\t\\\\t\\\\t\\\\t\\\\t\\\\tinstalledChunks[chunkId] = undefined;\\\\n \\\\t\\\\t\\\\t\\\\t\\\\t}\\\\n \\\\t\\\\t\\\\t\\\\t};\\\\n \\\\t\\\\t\\\\t\\\\tvar timeout = setTimeout(function(){\\\\n \\\\t\\\\t\\\\t\\\\t\\\\tonScriptComplete({ type: 'timeout', target: script });\\\\n \\\\t\\\\t\\\\t\\\\t}, 120000);\\\\n \\\\t\\\\t\\\\t\\\\tscript.onerror = script.onload = onScriptComplete;\\\\n \\\\t\\\\t\\\\t\\\\tdocument.head.appendChild(script);\\\\n \\\\t\\\\t\\\\t}\\\\n \\\\t\\\\t}\\\\n \\\\t\\\\treturn Promise.all(promises);\\\\n \\\\t};\\\\n\\\\n \\\\t// expose the modules object (__webpack_modules__)\\\\n \\\\t__webpack_require__.m = modules;\\\\n\\\\n \\\\t// expose the module cache\\\\n \\\\t__webpack_require__.c = installedModules;\\\\n\\\\n \\\\t// define getter function for harmony exports\\\\n \\\\t__webpack_require__.d = function(exports, name, getter) {\\\\n \\\\t\\\\tif(!__webpack_require__.o(exports, name)) {\\\\n \\\\t\\\\t\\\\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\\\\n \\\\t\\\\t}\\\\n \\\\t};\\\\n\\\\n \\\\t// define __esModule on exports\\\\n \\\\t__webpack_require__.r = function(exports) {\\\\n \\\\t\\\\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\\\\n \\\\t\\\\t\\\\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\\\\n \\\\t\\\\t}\\\\n \\\\t\\\\tObject.defineProperty(exports, '__esModule', { value: true });\\\\n \\\\t};\\\\n\\\\n \\\\t// create a fake namespace object\\\\n \\\\t// mode & 1: value is a module id, require it\\\\n \\\\t// mode & 2: merge all properties of value into the ns\\\\n \\\\t// mode & 4: return value when already ns object\\\\n \\\\t// mode & 8|1: behave like require\\\\n \\\\t__webpack_require__.t = function(value, mode) {\\\\n \\\\t\\\\tif(mode & 1) value = __webpack_require__(value);\\\\n \\\\t\\\\tif(mode & 8) return value;\\\\n \\\\t\\\\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\\\\n \\\\t\\\\tvar ns = Object.create(null);\\\\n \\\\t\\\\t__webpack_require__.r(ns);\\\\n \\\\t\\\\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\\\\n \\\\t\\\\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\\\\n \\\\t\\\\treturn ns;\\\\n \\\\t};\\\\n\\\\n \\\\t// getDefaultExport function for compatibility with non-harmony modules\\\\n \\\\t__webpack_require__.n = function(module) {\\\\n \\\\t\\\\tvar getter = module && module.__esModule ?\\\\n \\\\t\\\\t\\\\tfunction getDefault() { return module['default']; } :\\\\n \\\\t\\\\t\\\\tfunction getModuleExports() { return module; };\\\\n \\\\t\\\\t__webpack_require__.d(getter, 'a', getter);\\\\n \\\\t\\\\treturn getter;\\\\n \\\\t};\\\\n\\\\n \\\\t// Object.prototype.hasOwnProperty.call\\\\n \\\\t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\\\\n\\\\n \\\\t// __webpack_public_path__\\\\n \\\\t__webpack_require__.p = \\\\\\"\\\\\\";\\\\n\\\\n \\\\t// on error function for async loading\\\\n \\\\t__webpack_require__.oe = function(err) { console.error(err); throw err; };\\\\n\\\\n \\\\tvar jsonpArray = window[\\\\\\"webpackJsonp\\\\\\"] = window[\\\\\\"webpackJsonp\\\\\\"] || [];\\\\n \\\\tvar oldJsonpFunction = jsonpArray.push.bind(jsonpArray);\\\\n \\\\tjsonpArray.push = webpackJsonpCallback;\\\\n \\\\tjsonpArray = jsonpArray.slice();\\\\n \\\\tfor(var i = 0; i < jsonpArray.length; i++) webpackJsonpCallback(jsonpArray[i]);\\\\n \\\\tvar parentJsonpFunction = oldJsonpFunction;\\\\n\\\\n\\\\n \\\\t// Load entry module and return exports\\\\n \\\\treturn __webpack_require__(__webpack_require__.s = 2);\\\\n\\",\\"import(\\\\\\"./async-dep\\\\\\").then(() => {\\\\n console.log('Good')\\\\n});\\\\n\\\\nexport default \\\\\\"Awesome\\\\\\";\\\\n\\"],\\"sourceRoot\\":\\"\\"}", + "importExport.js": "!function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){\\"undefined\\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:\\"Module\\"}),Object.defineProperty(e,\\"__esModule\\",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&\\"object\\"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,\\"default\\",{enumerable:!0,value:e}),2&t&&\\"string\\"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,\\"a\\",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p=\\"\\",r(r.s=3)}({3:function(e,t,r){\\"use strict\\";r.r(t);t.default=function(){const e=\\"baz\\"+Math.random();return()=>({a:\\"foobar\\"+e,b:\\"foo\\",baz:e})}}}); +//# sourceMappingURL=importExport.js.map", + "importExport.js.map": "{\\"version\\":3,\\"sources\\":[\\"webpack:///webpack/bootstrap\\",\\"webpack:///./test/fixtures/import-export/entry.js\\",\\"webpack:///./test/fixtures/import-export/dep.js\\"],\\"names\\":[\\"installedModules\\",\\"__webpack_require__\\",\\"moduleId\\",\\"exports\\",\\"module\\",\\"i\\",\\"l\\",\\"modules\\",\\"call\\",\\"m\\",\\"c\\",\\"d\\",\\"name\\",\\"getter\\",\\"o\\",\\"Object\\",\\"defineProperty\\",\\"enumerable\\",\\"get\\",\\"r\\",\\"Symbol\\",\\"toStringTag\\",\\"value\\",\\"t\\",\\"mode\\",\\"__esModule\\",\\"ns\\",\\"create\\",\\"key\\",\\"bind\\",\\"n\\",\\"object\\",\\"property\\",\\"prototype\\",\\"hasOwnProperty\\",\\"p\\",\\"s\\",\\"baz\\",\\"Math\\",\\"random\\",\\"a\\",\\"b\\"],\\"mappings\\":\\"aACE,IAAIA,EAAmB,GAGvB,SAASC,EAAoBC,GAG5B,GAAGF,EAAiBE,GACnB,OAAOF,EAAiBE,GAAUC,QAGnC,IAAIC,EAASJ,EAAiBE,GAAY,CACzCG,EAAGH,EACHI,GAAG,EACHH,QAAS,IAUV,OANAI,EAAQL,GAAUM,KAAKJ,EAAOD,QAASC,EAAQA,EAAOD,QAASF,GAG/DG,EAAOE,GAAI,EAGJF,EAAOD,QAKfF,EAAoBQ,EAAIF,EAGxBN,EAAoBS,EAAIV,EAGxBC,EAAoBU,EAAI,SAASR,EAASS,EAAMC,GAC3CZ,EAAoBa,EAAEX,EAASS,IAClCG,OAAOC,eAAeb,EAASS,EAAM,CAAEK,YAAY,EAAMC,IAAKL,KAKhEZ,EAAoBkB,EAAI,SAAShB,GACX,oBAAXiB,QAA0BA,OAAOC,aAC1CN,OAAOC,eAAeb,EAASiB,OAAOC,YAAa,CAAEC,MAAO,WAE7DP,OAAOC,eAAeb,EAAS,aAAc,CAAEmB,OAAO,KAQvDrB,EAAoBsB,EAAI,SAASD,EAAOE,GAEvC,GADU,EAAPA,IAAUF,EAAQrB,EAAoBqB,IAC/B,EAAPE,EAAU,OAAOF,EACpB,GAAW,EAAPE,GAA8B,iBAAVF,GAAsBA,GAASA,EAAMG,WAAY,OAAOH,EAChF,IAAII,EAAKX,OAAOY,OAAO,MAGvB,GAFA1B,EAAoBkB,EAAEO,GACtBX,OAAOC,eAAeU,EAAI,UAAW,CAAET,YAAY,EAAMK,MAAOA,IACtD,EAAPE,GAA4B,iBAATF,EAAmB,IAAI,IAAIM,KAAON,EAAOrB,EAAoBU,EAAEe,EAAIE,EAAK,SAASA,GAAO,OAAON,EAAMM,IAAQC,KAAK,KAAMD,IAC9I,OAAOF,GAIRzB,EAAoB6B,EAAI,SAAS1B,GAChC,IAAIS,EAAST,GAAUA,EAAOqB,WAC7B,WAAwB,OAAOrB,EAAgB,SAC/C,WAA8B,OAAOA,GAEtC,OADAH,EAAoBU,EAAEE,EAAQ,IAAKA,GAC5BA,GAIRZ,EAAoBa,EAAI,SAASiB,EAAQC,GAAY,OAAOjB,OAAOkB,UAAUC,eAAe1B,KAAKuB,EAAQC,IAGzG/B,EAAoBkC,EAAI,GAIjBlC,EAAoBA,EAAoBmC,EAAI,G,wCCpEtC,UAZf,WACE,MACMC,EAAM,MAAMC,KAAKC,SACvB,MAAO,KACE,CACLC,EAAGC,SAAUJ,EACbI,ECPS,MDQTJ\\",\\"file\\":\\"importExport.js\\",\\"sourcesContent\\":[\\" \\\\t// The module cache\\\\n \\\\tvar installedModules = {};\\\\n\\\\n \\\\t// The require function\\\\n \\\\tfunction __webpack_require__(moduleId) {\\\\n\\\\n \\\\t\\\\t// Check if module is in cache\\\\n \\\\t\\\\tif(installedModules[moduleId]) {\\\\n \\\\t\\\\t\\\\treturn installedModules[moduleId].exports;\\\\n \\\\t\\\\t}\\\\n \\\\t\\\\t// Create a new module (and put it into the cache)\\\\n \\\\t\\\\tvar module = installedModules[moduleId] = {\\\\n \\\\t\\\\t\\\\ti: moduleId,\\\\n \\\\t\\\\t\\\\tl: false,\\\\n \\\\t\\\\t\\\\texports: {}\\\\n \\\\t\\\\t};\\\\n\\\\n \\\\t\\\\t// Execute the module function\\\\n \\\\t\\\\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\\\\n\\\\n \\\\t\\\\t// Flag the module as loaded\\\\n \\\\t\\\\tmodule.l = true;\\\\n\\\\n \\\\t\\\\t// Return the exports of the module\\\\n \\\\t\\\\treturn module.exports;\\\\n \\\\t}\\\\n\\\\n\\\\n \\\\t// expose the modules object (__webpack_modules__)\\\\n \\\\t__webpack_require__.m = modules;\\\\n\\\\n \\\\t// expose the module cache\\\\n \\\\t__webpack_require__.c = installedModules;\\\\n\\\\n \\\\t// define getter function for harmony exports\\\\n \\\\t__webpack_require__.d = function(exports, name, getter) {\\\\n \\\\t\\\\tif(!__webpack_require__.o(exports, name)) {\\\\n \\\\t\\\\t\\\\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\\\\n \\\\t\\\\t}\\\\n \\\\t};\\\\n\\\\n \\\\t// define __esModule on exports\\\\n \\\\t__webpack_require__.r = function(exports) {\\\\n \\\\t\\\\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\\\\n \\\\t\\\\t\\\\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\\\\n \\\\t\\\\t}\\\\n \\\\t\\\\tObject.defineProperty(exports, '__esModule', { value: true });\\\\n \\\\t};\\\\n\\\\n \\\\t// create a fake namespace object\\\\n \\\\t// mode & 1: value is a module id, require it\\\\n \\\\t// mode & 2: merge all properties of value into the ns\\\\n \\\\t// mode & 4: return value when already ns object\\\\n \\\\t// mode & 8|1: behave like require\\\\n \\\\t__webpack_require__.t = function(value, mode) {\\\\n \\\\t\\\\tif(mode & 1) value = __webpack_require__(value);\\\\n \\\\t\\\\tif(mode & 8) return value;\\\\n \\\\t\\\\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\\\\n \\\\t\\\\tvar ns = Object.create(null);\\\\n \\\\t\\\\t__webpack_require__.r(ns);\\\\n \\\\t\\\\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\\\\n \\\\t\\\\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\\\\n \\\\t\\\\treturn ns;\\\\n \\\\t};\\\\n\\\\n \\\\t// getDefaultExport function for compatibility with non-harmony modules\\\\n \\\\t__webpack_require__.n = function(module) {\\\\n \\\\t\\\\tvar getter = module && module.__esModule ?\\\\n \\\\t\\\\t\\\\tfunction getDefault() { return module['default']; } :\\\\n \\\\t\\\\t\\\\tfunction getModuleExports() { return module; };\\\\n \\\\t\\\\t__webpack_require__.d(getter, 'a', getter);\\\\n \\\\t\\\\treturn getter;\\\\n \\\\t};\\\\n\\\\n \\\\t// Object.prototype.hasOwnProperty.call\\\\n \\\\t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\\\\n\\\\n \\\\t// __webpack_public_path__\\\\n \\\\t__webpack_require__.p = \\\\\\"\\\\\\";\\\\n\\\\n\\\\n \\\\t// Load entry module and return exports\\\\n \\\\treturn __webpack_require__(__webpack_require__.s = 3);\\\\n\\",\\"import foo, { bar } from './dep';\\\\n\\\\nfunction Foo() {\\\\n const b = foo;\\\\n const baz = \`baz\${Math.random()}\`;\\\\n return () => {\\\\n return {\\\\n a: b + bar + baz,\\\\n b,\\\\n baz,\\\\n };\\\\n };\\\\n}\\\\n\\\\nexport default Foo;\\\\n\\",\\"export const bar = 'bar';\\\\nexport default 'foo';\\\\n\\"],\\"sourceRoot\\":\\"\\"}", + "js.js": "function changed(){}!function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){\\"undefined\\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:\\"Module\\"}),Object.defineProperty(e,\\"__esModule\\",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&\\"object\\"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,\\"default\\",{enumerable:!0,value:e}),2&t&&\\"string\\"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,\\"a\\",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p=\\"\\",n(n.s=0)}([function(e,t){e.exports=function(){console.log(7)}}]); +//# sourceMappingURL=js.js.map", + "js.js.map": "{\\"version\\":3,\\"sources\\":[\\"webpack:///webpack/bootstrap\\",\\"webpack:///./test/fixtures/entry.js\\"],\\"names\\":[\\"installedModules\\",\\"__webpack_require__\\",\\"moduleId\\",\\"exports\\",\\"module\\",\\"i\\",\\"l\\",\\"modules\\",\\"call\\",\\"m\\",\\"c\\",\\"d\\",\\"name\\",\\"getter\\",\\"o\\",\\"Object\\",\\"defineProperty\\",\\"enumerable\\",\\"get\\",\\"r\\",\\"Symbol\\",\\"toStringTag\\",\\"value\\",\\"t\\",\\"mode\\",\\"__esModule\\",\\"ns\\",\\"create\\",\\"key\\",\\"bind\\",\\"n\\",\\"object\\",\\"property\\",\\"prototype\\",\\"hasOwnProperty\\",\\"p\\",\\"s\\",\\"console\\",\\"log\\",\\"b\\"],\\"mappings\\":\\"iCACE,IAAIA,EAAmB,GAGvB,SAASC,EAAoBC,GAG5B,GAAGF,EAAiBE,GACnB,OAAOF,EAAiBE,GAAUC,QAGnC,IAAIC,EAASJ,EAAiBE,GAAY,CACzCG,EAAGH,EACHI,GAAG,EACHH,QAAS,IAUV,OANAI,EAAQL,GAAUM,KAAKJ,EAAOD,QAASC,EAAQA,EAAOD,QAASF,GAG/DG,EAAOE,GAAI,EAGJF,EAAOD,QAKfF,EAAoBQ,EAAIF,EAGxBN,EAAoBS,EAAIV,EAGxBC,EAAoBU,EAAI,SAASR,EAASS,EAAMC,GAC3CZ,EAAoBa,EAAEX,EAASS,IAClCG,OAAOC,eAAeb,EAASS,EAAM,CAAEK,YAAY,EAAMC,IAAKL,KAKhEZ,EAAoBkB,EAAI,SAAShB,GACX,oBAAXiB,QAA0BA,OAAOC,aAC1CN,OAAOC,eAAeb,EAASiB,OAAOC,YAAa,CAAEC,MAAO,WAE7DP,OAAOC,eAAeb,EAAS,aAAc,CAAEmB,OAAO,KAQvDrB,EAAoBsB,EAAI,SAASD,EAAOE,GAEvC,GADU,EAAPA,IAAUF,EAAQrB,EAAoBqB,IAC/B,EAAPE,EAAU,OAAOF,EACpB,GAAW,EAAPE,GAA8B,iBAAVF,GAAsBA,GAASA,EAAMG,WAAY,OAAOH,EAChF,IAAII,EAAKX,OAAOY,OAAO,MAGvB,GAFA1B,EAAoBkB,EAAEO,GACtBX,OAAOC,eAAeU,EAAI,UAAW,CAAET,YAAY,EAAMK,MAAOA,IACtD,EAAPE,GAA4B,iBAATF,EAAmB,IAAI,IAAIM,KAAON,EAAOrB,EAAoBU,EAAEe,EAAIE,EAAK,SAASA,GAAO,OAAON,EAAMM,IAAQC,KAAK,KAAMD,IAC9I,OAAOF,GAIRzB,EAAoB6B,EAAI,SAAS1B,GAChC,IAAIS,EAAST,GAAUA,EAAOqB,WAC7B,WAAwB,OAAOrB,EAAgB,SAC/C,WAA8B,OAAOA,GAEtC,OADAH,EAAoBU,EAAEE,EAAQ,IAAKA,GAC5BA,GAIRZ,EAAoBa,EAAI,SAASiB,EAAQC,GAAY,OAAOjB,OAAOkB,UAAUC,eAAe1B,KAAKuB,EAAQC,IAGzG/B,EAAoBkC,EAAI,GAIjBlC,EAAoBA,EAAoBmC,EAAI,G,gBC7ErDhC,EAAOD,QAAU,WAEfkC,QAAQC,IAAIC\\",\\"file\\":\\"js.js\\",\\"sourcesContent\\":[\\" \\\\t// The module cache\\\\n \\\\tvar installedModules = {};\\\\n\\\\n \\\\t// The require function\\\\n \\\\tfunction __webpack_require__(moduleId) {\\\\n\\\\n \\\\t\\\\t// Check if module is in cache\\\\n \\\\t\\\\tif(installedModules[moduleId]) {\\\\n \\\\t\\\\t\\\\treturn installedModules[moduleId].exports;\\\\n \\\\t\\\\t}\\\\n \\\\t\\\\t// Create a new module (and put it into the cache)\\\\n \\\\t\\\\tvar module = installedModules[moduleId] = {\\\\n \\\\t\\\\t\\\\ti: moduleId,\\\\n \\\\t\\\\t\\\\tl: false,\\\\n \\\\t\\\\t\\\\texports: {}\\\\n \\\\t\\\\t};\\\\n\\\\n \\\\t\\\\t// Execute the module function\\\\n \\\\t\\\\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\\\\n\\\\n \\\\t\\\\t// Flag the module as loaded\\\\n \\\\t\\\\tmodule.l = true;\\\\n\\\\n \\\\t\\\\t// Return the exports of the module\\\\n \\\\t\\\\treturn module.exports;\\\\n \\\\t}\\\\n\\\\n\\\\n \\\\t// expose the modules object (__webpack_modules__)\\\\n \\\\t__webpack_require__.m = modules;\\\\n\\\\n \\\\t// expose the module cache\\\\n \\\\t__webpack_require__.c = installedModules;\\\\n\\\\n \\\\t// define getter function for harmony exports\\\\n \\\\t__webpack_require__.d = function(exports, name, getter) {\\\\n \\\\t\\\\tif(!__webpack_require__.o(exports, name)) {\\\\n \\\\t\\\\t\\\\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\\\\n \\\\t\\\\t}\\\\n \\\\t};\\\\n\\\\n \\\\t// define __esModule on exports\\\\n \\\\t__webpack_require__.r = function(exports) {\\\\n \\\\t\\\\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\\\\n \\\\t\\\\t\\\\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\\\\n \\\\t\\\\t}\\\\n \\\\t\\\\tObject.defineProperty(exports, '__esModule', { value: true });\\\\n \\\\t};\\\\n\\\\n \\\\t// create a fake namespace object\\\\n \\\\t// mode & 1: value is a module id, require it\\\\n \\\\t// mode & 2: merge all properties of value into the ns\\\\n \\\\t// mode & 4: return value when already ns object\\\\n \\\\t// mode & 8|1: behave like require\\\\n \\\\t__webpack_require__.t = function(value, mode) {\\\\n \\\\t\\\\tif(mode & 1) value = __webpack_require__(value);\\\\n \\\\t\\\\tif(mode & 8) return value;\\\\n \\\\t\\\\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\\\\n \\\\t\\\\tvar ns = Object.create(null);\\\\n \\\\t\\\\t__webpack_require__.r(ns);\\\\n \\\\t\\\\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\\\\n \\\\t\\\\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\\\\n \\\\t\\\\treturn ns;\\\\n \\\\t};\\\\n\\\\n \\\\t// getDefaultExport function for compatibility with non-harmony modules\\\\n \\\\t__webpack_require__.n = function(module) {\\\\n \\\\t\\\\tvar getter = module && module.__esModule ?\\\\n \\\\t\\\\t\\\\tfunction getDefault() { return module['default']; } :\\\\n \\\\t\\\\t\\\\tfunction getModuleExports() { return module; };\\\\n \\\\t\\\\t__webpack_require__.d(getter, 'a', getter);\\\\n \\\\t\\\\treturn getter;\\\\n \\\\t};\\\\n\\\\n \\\\t// Object.prototype.hasOwnProperty.call\\\\n \\\\t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\\\\n\\\\n \\\\t// __webpack_public_path__\\\\n \\\\t__webpack_require__.p = \\\\\\"\\\\\\";\\\\n\\\\n\\\\n \\\\t// Load entry module and return exports\\\\n \\\\treturn __webpack_require__(__webpack_require__.s = 0);\\\\n\\",\\"// foo\\\\n/* @preserve*/\\\\n// bar\\\\nconst a = 2 + 2;\\\\n\\\\nmodule.exports = function Foo() {\\\\n const b = 2 + 2;\\\\n console.log(b + 1 + 2);\\\\n};\\\\n\\"],\\"sourceRoot\\":\\"\\"}", + "mjs.js": "!function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){\\"undefined\\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:\\"Module\\"}),Object.defineProperty(e,\\"__esModule\\",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&\\"object\\"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,\\"default\\",{enumerable:!0,value:e}),2&t&&\\"string\\"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,\\"a\\",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p=\\"\\",r(r.s=1)}([,function(e,t,r){\\"use strict\\";r.r(t);module.exports=function(){console.log(7)}}]); +//# sourceMappingURL=mjs.js.map", + "mjs.js.map": "{\\"version\\":3,\\"sources\\":[\\"webpack:///webpack/bootstrap\\",\\"webpack:///./test/fixtures/entry.mjs\\"],\\"names\\":[\\"installedModules\\",\\"__webpack_require__\\",\\"moduleId\\",\\"exports\\",\\"module\\",\\"i\\",\\"l\\",\\"modules\\",\\"call\\",\\"m\\",\\"c\\",\\"d\\",\\"name\\",\\"getter\\",\\"o\\",\\"Object\\",\\"defineProperty\\",\\"enumerable\\",\\"get\\",\\"r\\",\\"Symbol\\",\\"toStringTag\\",\\"value\\",\\"t\\",\\"mode\\",\\"__esModule\\",\\"ns\\",\\"create\\",\\"key\\",\\"bind\\",\\"n\\",\\"object\\",\\"property\\",\\"prototype\\",\\"hasOwnProperty\\",\\"p\\",\\"s\\",\\"console\\",\\"log\\",\\"b\\"],\\"mappings\\":\\"aACE,IAAIA,EAAmB,GAGvB,SAASC,EAAoBC,GAG5B,GAAGF,EAAiBE,GACnB,OAAOF,EAAiBE,GAAUC,QAGnC,IAAIC,EAASJ,EAAiBE,GAAY,CACzCG,EAAGH,EACHI,GAAG,EACHH,QAAS,IAUV,OANAI,EAAQL,GAAUM,KAAKJ,EAAOD,QAASC,EAAQA,EAAOD,QAASF,GAG/DG,EAAOE,GAAI,EAGJF,EAAOD,QAKfF,EAAoBQ,EAAIF,EAGxBN,EAAoBS,EAAIV,EAGxBC,EAAoBU,EAAI,SAASR,EAASS,EAAMC,GAC3CZ,EAAoBa,EAAEX,EAASS,IAClCG,OAAOC,eAAeb,EAASS,EAAM,CAAEK,YAAY,EAAMC,IAAKL,KAKhEZ,EAAoBkB,EAAI,SAAShB,GACX,oBAAXiB,QAA0BA,OAAOC,aAC1CN,OAAOC,eAAeb,EAASiB,OAAOC,YAAa,CAAEC,MAAO,WAE7DP,OAAOC,eAAeb,EAAS,aAAc,CAAEmB,OAAO,KAQvDrB,EAAoBsB,EAAI,SAASD,EAAOE,GAEvC,GADU,EAAPA,IAAUF,EAAQrB,EAAoBqB,IAC/B,EAAPE,EAAU,OAAOF,EACpB,GAAW,EAAPE,GAA8B,iBAAVF,GAAsBA,GAASA,EAAMG,WAAY,OAAOH,EAChF,IAAII,EAAKX,OAAOY,OAAO,MAGvB,GAFA1B,EAAoBkB,EAAEO,GACtBX,OAAOC,eAAeU,EAAI,UAAW,CAAET,YAAY,EAAMK,MAAOA,IACtD,EAAPE,GAA4B,iBAATF,EAAmB,IAAI,IAAIM,KAAON,EAAOrB,EAAoBU,EAAEe,EAAIE,EAAK,SAASA,GAAO,OAAON,EAAMM,IAAQC,KAAK,KAAMD,IAC9I,OAAOF,GAIRzB,EAAoB6B,EAAI,SAAS1B,GAChC,IAAIS,EAAST,GAAUA,EAAOqB,WAC7B,WAAwB,OAAOrB,EAAgB,SAC/C,WAA8B,OAAOA,GAEtC,OADAH,EAAoBU,EAAEE,EAAQ,IAAKA,GAC5BA,GAIRZ,EAAoBa,EAAI,SAASiB,EAAQC,GAAY,OAAOjB,OAAOkB,UAAUC,eAAe1B,KAAKuB,EAAQC,IAGzG/B,EAAoBkC,EAAI,GAIjBlC,EAAoBA,EAAoBmC,EAAI,G,gCClFrD,OAKAhC,OAAOD,QAAU,WAEfkC,QAAQC,IAAIC\\",\\"file\\":\\"mjs.js\\",\\"sourcesContent\\":[\\" \\\\t// The module cache\\\\n \\\\tvar installedModules = {};\\\\n\\\\n \\\\t// The require function\\\\n \\\\tfunction __webpack_require__(moduleId) {\\\\n\\\\n \\\\t\\\\t// Check if module is in cache\\\\n \\\\t\\\\tif(installedModules[moduleId]) {\\\\n \\\\t\\\\t\\\\treturn installedModules[moduleId].exports;\\\\n \\\\t\\\\t}\\\\n \\\\t\\\\t// Create a new module (and put it into the cache)\\\\n \\\\t\\\\tvar module = installedModules[moduleId] = {\\\\n \\\\t\\\\t\\\\ti: moduleId,\\\\n \\\\t\\\\t\\\\tl: false,\\\\n \\\\t\\\\t\\\\texports: {}\\\\n \\\\t\\\\t};\\\\n\\\\n \\\\t\\\\t// Execute the module function\\\\n \\\\t\\\\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\\\\n\\\\n \\\\t\\\\t// Flag the module as loaded\\\\n \\\\t\\\\tmodule.l = true;\\\\n\\\\n \\\\t\\\\t// Return the exports of the module\\\\n \\\\t\\\\treturn module.exports;\\\\n \\\\t}\\\\n\\\\n\\\\n \\\\t// expose the modules object (__webpack_modules__)\\\\n \\\\t__webpack_require__.m = modules;\\\\n\\\\n \\\\t// expose the module cache\\\\n \\\\t__webpack_require__.c = installedModules;\\\\n\\\\n \\\\t// define getter function for harmony exports\\\\n \\\\t__webpack_require__.d = function(exports, name, getter) {\\\\n \\\\t\\\\tif(!__webpack_require__.o(exports, name)) {\\\\n \\\\t\\\\t\\\\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\\\\n \\\\t\\\\t}\\\\n \\\\t};\\\\n\\\\n \\\\t// define __esModule on exports\\\\n \\\\t__webpack_require__.r = function(exports) {\\\\n \\\\t\\\\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\\\\n \\\\t\\\\t\\\\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\\\\n \\\\t\\\\t}\\\\n \\\\t\\\\tObject.defineProperty(exports, '__esModule', { value: true });\\\\n \\\\t};\\\\n\\\\n \\\\t// create a fake namespace object\\\\n \\\\t// mode & 1: value is a module id, require it\\\\n \\\\t// mode & 2: merge all properties of value into the ns\\\\n \\\\t// mode & 4: return value when already ns object\\\\n \\\\t// mode & 8|1: behave like require\\\\n \\\\t__webpack_require__.t = function(value, mode) {\\\\n \\\\t\\\\tif(mode & 1) value = __webpack_require__(value);\\\\n \\\\t\\\\tif(mode & 8) return value;\\\\n \\\\t\\\\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\\\\n \\\\t\\\\tvar ns = Object.create(null);\\\\n \\\\t\\\\t__webpack_require__.r(ns);\\\\n \\\\t\\\\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\\\\n \\\\t\\\\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\\\\n \\\\t\\\\treturn ns;\\\\n \\\\t};\\\\n\\\\n \\\\t// getDefaultExport function for compatibility with non-harmony modules\\\\n \\\\t__webpack_require__.n = function(module) {\\\\n \\\\t\\\\tvar getter = module && module.__esModule ?\\\\n \\\\t\\\\t\\\\tfunction getDefault() { return module['default']; } :\\\\n \\\\t\\\\t\\\\tfunction getModuleExports() { return module; };\\\\n \\\\t\\\\t__webpack_require__.d(getter, 'a', getter);\\\\n \\\\t\\\\treturn getter;\\\\n \\\\t};\\\\n\\\\n \\\\t// Object.prototype.hasOwnProperty.call\\\\n \\\\t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\\\\n\\\\n \\\\t// __webpack_public_path__\\\\n \\\\t__webpack_require__.p = \\\\\\"\\\\\\";\\\\n\\\\n\\\\n \\\\t// Load entry module and return exports\\\\n \\\\treturn __webpack_require__(__webpack_require__.s = 1);\\\\n\\",\\"// foo\\\\n/* @preserve*/\\\\n// bar\\\\nconst a = 2 + 2;\\\\n\\\\nmodule.exports = function Foo() {\\\\n const b = 2 + 2;\\\\n console.log(b + 1 + 2);\\\\n};\\\\n\\"],\\"sourceRoot\\":\\"\\"}", +} +`; + +exports[`TerserPlugin should work with source map and use memory cache when the "cache" option is "true" and the asset has been changed: errors 1`] = `Array []`; + +exports[`TerserPlugin should work with source map and use memory cache when the "cache" option is "true" and the asset has been changed: errors 2`] = `Array []`; + +exports[`TerserPlugin should work with source map and use memory cache when the "cache" option is "true" and the asset has been changed: warnings 1`] = `Array []`; + +exports[`TerserPlugin should work with source map and use memory cache when the "cache" option is "true" and the asset has been changed: warnings 2`] = `Array []`; + +exports[`TerserPlugin should work with source map and use memory cache when the "cache" option is "true": assets 1`] = ` +Object { + "4.4.js": "(window.webpackJsonp=window.webpackJsonp||[]).push([[4],{4:function(n,p,s){\\"use strict\\";s.r(p),p.default=\\"async-dep\\"}}]); +//# sourceMappingURL=4.4.js.map", + "4.4.js.map": "{\\"version\\":3,\\"sources\\":[\\"webpack:///./test/fixtures/async-import-export/async-dep.js\\"],\\"names\\":[],\\"mappings\\":\\"wFAAA,OAAe\\",\\"file\\":\\"4.4.js\\",\\"sourcesContent\\":[\\"export default \\\\\\"async-dep\\\\\\";\\\\n\\"],\\"sourceRoot\\":\\"\\"}", + "AsyncImportExport.js": "!function(e){function t(t){for(var r,o,u=t[0],i=t[1],a=0,l=[];a{console.log(\\"Good\\")}),t.default=\\"Awesome\\"}}); +//# sourceMappingURL=AsyncImportExport.js.map", + "AsyncImportExport.js.map": "{\\"version\\":3,\\"sources\\":[\\"webpack:///webpack/bootstrap\\",\\"webpack:///./test/fixtures/async-import-export/entry.js\\"],\\"names\\":[\\"webpackJsonpCallback\\",\\"data\\",\\"moduleId\\",\\"chunkId\\",\\"chunkIds\\",\\"moreModules\\",\\"i\\",\\"resolves\\",\\"length\\",\\"Object\\",\\"prototype\\",\\"hasOwnProperty\\",\\"call\\",\\"installedChunks\\",\\"push\\",\\"modules\\",\\"parentJsonpFunction\\",\\"shift\\",\\"installedModules\\",\\"0\\",\\"__webpack_require__\\",\\"exports\\",\\"module\\",\\"l\\",\\"e\\",\\"promises\\",\\"installedChunkData\\",\\"promise\\",\\"Promise\\",\\"resolve\\",\\"reject\\",\\"onScriptComplete\\",\\"script\\",\\"document\\",\\"createElement\\",\\"charset\\",\\"timeout\\",\\"nc\\",\\"setAttribute\\",\\"src\\",\\"p\\",\\"jsonpScriptSrc\\",\\"error\\",\\"Error\\",\\"event\\",\\"onerror\\",\\"onload\\",\\"clearTimeout\\",\\"chunk\\",\\"errorType\\",\\"type\\",\\"realSrc\\",\\"target\\",\\"message\\",\\"name\\",\\"request\\",\\"undefined\\",\\"setTimeout\\",\\"head\\",\\"appendChild\\",\\"all\\",\\"m\\",\\"c\\",\\"d\\",\\"getter\\",\\"o\\",\\"defineProperty\\",\\"enumerable\\",\\"get\\",\\"r\\",\\"Symbol\\",\\"toStringTag\\",\\"value\\",\\"t\\",\\"mode\\",\\"__esModule\\",\\"ns\\",\\"create\\",\\"key\\",\\"bind\\",\\"n\\",\\"object\\",\\"property\\",\\"oe\\",\\"err\\",\\"console\\",\\"jsonpArray\\",\\"window\\",\\"oldJsonpFunction\\",\\"slice\\",\\"s\\",\\"then\\",\\"log\\"],\\"mappings\\":\\"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\\",\\"file\\":\\"AsyncImportExport.js\\",\\"sourcesContent\\":[\\" \\\\t// install a JSONP callback for chunk loading\\\\n \\\\tfunction webpackJsonpCallback(data) {\\\\n \\\\t\\\\tvar chunkIds = data[0];\\\\n \\\\t\\\\tvar moreModules = data[1];\\\\n\\\\n\\\\n \\\\t\\\\t// add \\\\\\"moreModules\\\\\\" to the modules object,\\\\n \\\\t\\\\t// then flag all \\\\\\"chunkIds\\\\\\" as loaded and fire callback\\\\n \\\\t\\\\tvar moduleId, chunkId, i = 0, resolves = [];\\\\n \\\\t\\\\tfor(;i < chunkIds.length; i++) {\\\\n \\\\t\\\\t\\\\tchunkId = chunkIds[i];\\\\n \\\\t\\\\t\\\\tif(Object.prototype.hasOwnProperty.call(installedChunks, chunkId) && installedChunks[chunkId]) {\\\\n \\\\t\\\\t\\\\t\\\\tresolves.push(installedChunks[chunkId][0]);\\\\n \\\\t\\\\t\\\\t}\\\\n \\\\t\\\\t\\\\tinstalledChunks[chunkId] = 0;\\\\n \\\\t\\\\t}\\\\n \\\\t\\\\tfor(moduleId in moreModules) {\\\\n \\\\t\\\\t\\\\tif(Object.prototype.hasOwnProperty.call(moreModules, moduleId)) {\\\\n \\\\t\\\\t\\\\t\\\\tmodules[moduleId] = moreModules[moduleId];\\\\n \\\\t\\\\t\\\\t}\\\\n \\\\t\\\\t}\\\\n \\\\t\\\\tif(parentJsonpFunction) parentJsonpFunction(data);\\\\n\\\\n \\\\t\\\\twhile(resolves.length) {\\\\n \\\\t\\\\t\\\\tresolves.shift()();\\\\n \\\\t\\\\t}\\\\n\\\\n \\\\t};\\\\n\\\\n\\\\n \\\\t// The module cache\\\\n \\\\tvar installedModules = {};\\\\n\\\\n \\\\t// object to store loaded and loading chunks\\\\n \\\\t// undefined = chunk not loaded, null = chunk preloaded/prefetched\\\\n \\\\t// Promise = chunk loading, 0 = chunk loaded\\\\n \\\\tvar installedChunks = {\\\\n \\\\t\\\\t0: 0\\\\n \\\\t};\\\\n\\\\n\\\\n\\\\n \\\\t// script path function\\\\n \\\\tfunction jsonpScriptSrc(chunkId) {\\\\n \\\\t\\\\treturn __webpack_require__.p + \\\\\\"\\\\\\" + chunkId + \\\\\\".\\\\\\" + ({}[chunkId]||chunkId) + \\\\\\".js\\\\\\"\\\\n \\\\t}\\\\n\\\\n \\\\t// The require function\\\\n \\\\tfunction __webpack_require__(moduleId) {\\\\n\\\\n \\\\t\\\\t// Check if module is in cache\\\\n \\\\t\\\\tif(installedModules[moduleId]) {\\\\n \\\\t\\\\t\\\\treturn installedModules[moduleId].exports;\\\\n \\\\t\\\\t}\\\\n \\\\t\\\\t// Create a new module (and put it into the cache)\\\\n \\\\t\\\\tvar module = installedModules[moduleId] = {\\\\n \\\\t\\\\t\\\\ti: moduleId,\\\\n \\\\t\\\\t\\\\tl: false,\\\\n \\\\t\\\\t\\\\texports: {}\\\\n \\\\t\\\\t};\\\\n\\\\n \\\\t\\\\t// Execute the module function\\\\n \\\\t\\\\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\\\\n\\\\n \\\\t\\\\t// Flag the module as loaded\\\\n \\\\t\\\\tmodule.l = true;\\\\n\\\\n \\\\t\\\\t// Return the exports of the module\\\\n \\\\t\\\\treturn module.exports;\\\\n \\\\t}\\\\n\\\\n \\\\t// This file contains only the entry chunk.\\\\n \\\\t// The chunk loading function for additional chunks\\\\n \\\\t__webpack_require__.e = function requireEnsure(chunkId) {\\\\n \\\\t\\\\tvar promises = [];\\\\n\\\\n\\\\n \\\\t\\\\t// JSONP chunk loading for javascript\\\\n\\\\n \\\\t\\\\tvar installedChunkData = installedChunks[chunkId];\\\\n \\\\t\\\\tif(installedChunkData !== 0) { // 0 means \\\\\\"already installed\\\\\\".\\\\n\\\\n \\\\t\\\\t\\\\t// a Promise means \\\\\\"currently loading\\\\\\".\\\\n \\\\t\\\\t\\\\tif(installedChunkData) {\\\\n \\\\t\\\\t\\\\t\\\\tpromises.push(installedChunkData[2]);\\\\n \\\\t\\\\t\\\\t} else {\\\\n \\\\t\\\\t\\\\t\\\\t// setup Promise in chunk cache\\\\n \\\\t\\\\t\\\\t\\\\tvar promise = new Promise(function(resolve, reject) {\\\\n \\\\t\\\\t\\\\t\\\\t\\\\tinstalledChunkData = installedChunks[chunkId] = [resolve, reject];\\\\n \\\\t\\\\t\\\\t\\\\t});\\\\n \\\\t\\\\t\\\\t\\\\tpromises.push(installedChunkData[2] = promise);\\\\n\\\\n \\\\t\\\\t\\\\t\\\\t// start chunk loading\\\\n \\\\t\\\\t\\\\t\\\\tvar script = document.createElement('script');\\\\n \\\\t\\\\t\\\\t\\\\tvar onScriptComplete;\\\\n\\\\n \\\\t\\\\t\\\\t\\\\tscript.charset = 'utf-8';\\\\n \\\\t\\\\t\\\\t\\\\tscript.timeout = 120;\\\\n \\\\t\\\\t\\\\t\\\\tif (__webpack_require__.nc) {\\\\n \\\\t\\\\t\\\\t\\\\t\\\\tscript.setAttribute(\\\\\\"nonce\\\\\\", __webpack_require__.nc);\\\\n \\\\t\\\\t\\\\t\\\\t}\\\\n \\\\t\\\\t\\\\t\\\\tscript.src = jsonpScriptSrc(chunkId);\\\\n\\\\n \\\\t\\\\t\\\\t\\\\t// create error before stack unwound to get useful stacktrace later\\\\n \\\\t\\\\t\\\\t\\\\tvar error = new Error();\\\\n \\\\t\\\\t\\\\t\\\\tonScriptComplete = function (event) {\\\\n \\\\t\\\\t\\\\t\\\\t\\\\t// avoid mem leaks in IE.\\\\n \\\\t\\\\t\\\\t\\\\t\\\\tscript.onerror = script.onload = null;\\\\n \\\\t\\\\t\\\\t\\\\t\\\\tclearTimeout(timeout);\\\\n \\\\t\\\\t\\\\t\\\\t\\\\tvar chunk = installedChunks[chunkId];\\\\n \\\\t\\\\t\\\\t\\\\t\\\\tif(chunk !== 0) {\\\\n \\\\t\\\\t\\\\t\\\\t\\\\t\\\\tif(chunk) {\\\\n \\\\t\\\\t\\\\t\\\\t\\\\t\\\\t\\\\tvar errorType = event && (event.type === 'load' ? 'missing' : event.type);\\\\n \\\\t\\\\t\\\\t\\\\t\\\\t\\\\t\\\\tvar realSrc = event && event.target && event.target.src;\\\\n \\\\t\\\\t\\\\t\\\\t\\\\t\\\\t\\\\terror.message = 'Loading chunk ' + chunkId + ' failed.\\\\\\\\n(' + errorType + ': ' + realSrc + ')';\\\\n \\\\t\\\\t\\\\t\\\\t\\\\t\\\\t\\\\terror.name = 'ChunkLoadError';\\\\n \\\\t\\\\t\\\\t\\\\t\\\\t\\\\t\\\\terror.type = errorType;\\\\n \\\\t\\\\t\\\\t\\\\t\\\\t\\\\t\\\\terror.request = realSrc;\\\\n \\\\t\\\\t\\\\t\\\\t\\\\t\\\\t\\\\tchunk[1](error);\\\\n \\\\t\\\\t\\\\t\\\\t\\\\t\\\\t}\\\\n \\\\t\\\\t\\\\t\\\\t\\\\t\\\\tinstalledChunks[chunkId] = undefined;\\\\n \\\\t\\\\t\\\\t\\\\t\\\\t}\\\\n \\\\t\\\\t\\\\t\\\\t};\\\\n \\\\t\\\\t\\\\t\\\\tvar timeout = setTimeout(function(){\\\\n \\\\t\\\\t\\\\t\\\\t\\\\tonScriptComplete({ type: 'timeout', target: script });\\\\n \\\\t\\\\t\\\\t\\\\t}, 120000);\\\\n \\\\t\\\\t\\\\t\\\\tscript.onerror = script.onload = onScriptComplete;\\\\n \\\\t\\\\t\\\\t\\\\tdocument.head.appendChild(script);\\\\n \\\\t\\\\t\\\\t}\\\\n \\\\t\\\\t}\\\\n \\\\t\\\\treturn Promise.all(promises);\\\\n \\\\t};\\\\n\\\\n \\\\t// expose the modules object (__webpack_modules__)\\\\n \\\\t__webpack_require__.m = modules;\\\\n\\\\n \\\\t// expose the module cache\\\\n \\\\t__webpack_require__.c = installedModules;\\\\n\\\\n \\\\t// define getter function for harmony exports\\\\n \\\\t__webpack_require__.d = function(exports, name, getter) {\\\\n \\\\t\\\\tif(!__webpack_require__.o(exports, name)) {\\\\n \\\\t\\\\t\\\\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\\\\n \\\\t\\\\t}\\\\n \\\\t};\\\\n\\\\n \\\\t// define __esModule on exports\\\\n \\\\t__webpack_require__.r = function(exports) {\\\\n \\\\t\\\\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\\\\n \\\\t\\\\t\\\\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\\\\n \\\\t\\\\t}\\\\n \\\\t\\\\tObject.defineProperty(exports, '__esModule', { value: true });\\\\n \\\\t};\\\\n\\\\n \\\\t// create a fake namespace object\\\\n \\\\t// mode & 1: value is a module id, require it\\\\n \\\\t// mode & 2: merge all properties of value into the ns\\\\n \\\\t// mode & 4: return value when already ns object\\\\n \\\\t// mode & 8|1: behave like require\\\\n \\\\t__webpack_require__.t = function(value, mode) {\\\\n \\\\t\\\\tif(mode & 1) value = __webpack_require__(value);\\\\n \\\\t\\\\tif(mode & 8) return value;\\\\n \\\\t\\\\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\\\\n \\\\t\\\\tvar ns = Object.create(null);\\\\n \\\\t\\\\t__webpack_require__.r(ns);\\\\n \\\\t\\\\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\\\\n \\\\t\\\\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\\\\n \\\\t\\\\treturn ns;\\\\n \\\\t};\\\\n\\\\n \\\\t// getDefaultExport function for compatibility with non-harmony modules\\\\n \\\\t__webpack_require__.n = function(module) {\\\\n \\\\t\\\\tvar getter = module && module.__esModule ?\\\\n \\\\t\\\\t\\\\tfunction getDefault() { return module['default']; } :\\\\n \\\\t\\\\t\\\\tfunction getModuleExports() { return module; };\\\\n \\\\t\\\\t__webpack_require__.d(getter, 'a', getter);\\\\n \\\\t\\\\treturn getter;\\\\n \\\\t};\\\\n\\\\n \\\\t// Object.prototype.hasOwnProperty.call\\\\n \\\\t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\\\\n\\\\n \\\\t// __webpack_public_path__\\\\n \\\\t__webpack_require__.p = \\\\\\"\\\\\\";\\\\n\\\\n \\\\t// on error function for async loading\\\\n \\\\t__webpack_require__.oe = function(err) { console.error(err); throw err; };\\\\n\\\\n \\\\tvar jsonpArray = window[\\\\\\"webpackJsonp\\\\\\"] = window[\\\\\\"webpackJsonp\\\\\\"] || [];\\\\n \\\\tvar oldJsonpFunction = jsonpArray.push.bind(jsonpArray);\\\\n \\\\tjsonpArray.push = webpackJsonpCallback;\\\\n \\\\tjsonpArray = jsonpArray.slice();\\\\n \\\\tfor(var i = 0; i < jsonpArray.length; i++) webpackJsonpCallback(jsonpArray[i]);\\\\n \\\\tvar parentJsonpFunction = oldJsonpFunction;\\\\n\\\\n\\\\n \\\\t// Load entry module and return exports\\\\n \\\\treturn __webpack_require__(__webpack_require__.s = 2);\\\\n\\",\\"import(\\\\\\"./async-dep\\\\\\").then(() => {\\\\n console.log('Good')\\\\n});\\\\n\\\\nexport default \\\\\\"Awesome\\\\\\";\\\\n\\"],\\"sourceRoot\\":\\"\\"}", + "importExport.js": "!function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){\\"undefined\\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:\\"Module\\"}),Object.defineProperty(e,\\"__esModule\\",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&\\"object\\"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,\\"default\\",{enumerable:!0,value:e}),2&t&&\\"string\\"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,\\"a\\",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p=\\"\\",r(r.s=3)}({3:function(e,t,r){\\"use strict\\";r.r(t);t.default=function(){const e=\\"baz\\"+Math.random();return()=>({a:\\"foobar\\"+e,b:\\"foo\\",baz:e})}}}); +//# sourceMappingURL=importExport.js.map", + "importExport.js.map": "{\\"version\\":3,\\"sources\\":[\\"webpack:///webpack/bootstrap\\",\\"webpack:///./test/fixtures/import-export/entry.js\\",\\"webpack:///./test/fixtures/import-export/dep.js\\"],\\"names\\":[\\"installedModules\\",\\"__webpack_require__\\",\\"moduleId\\",\\"exports\\",\\"module\\",\\"i\\",\\"l\\",\\"modules\\",\\"call\\",\\"m\\",\\"c\\",\\"d\\",\\"name\\",\\"getter\\",\\"o\\",\\"Object\\",\\"defineProperty\\",\\"enumerable\\",\\"get\\",\\"r\\",\\"Symbol\\",\\"toStringTag\\",\\"value\\",\\"t\\",\\"mode\\",\\"__esModule\\",\\"ns\\",\\"create\\",\\"key\\",\\"bind\\",\\"n\\",\\"object\\",\\"property\\",\\"prototype\\",\\"hasOwnProperty\\",\\"p\\",\\"s\\",\\"baz\\",\\"Math\\",\\"random\\",\\"a\\",\\"b\\"],\\"mappings\\":\\"aACE,IAAIA,EAAmB,GAGvB,SAASC,EAAoBC,GAG5B,GAAGF,EAAiBE,GACnB,OAAOF,EAAiBE,GAAUC,QAGnC,IAAIC,EAASJ,EAAiBE,GAAY,CACzCG,EAAGH,EACHI,GAAG,EACHH,QAAS,IAUV,OANAI,EAAQL,GAAUM,KAAKJ,EAAOD,QAASC,EAAQA,EAAOD,QAASF,GAG/DG,EAAOE,GAAI,EAGJF,EAAOD,QAKfF,EAAoBQ,EAAIF,EAGxBN,EAAoBS,EAAIV,EAGxBC,EAAoBU,EAAI,SAASR,EAASS,EAAMC,GAC3CZ,EAAoBa,EAAEX,EAASS,IAClCG,OAAOC,eAAeb,EAASS,EAAM,CAAEK,YAAY,EAAMC,IAAKL,KAKhEZ,EAAoBkB,EAAI,SAAShB,GACX,oBAAXiB,QAA0BA,OAAOC,aAC1CN,OAAOC,eAAeb,EAASiB,OAAOC,YAAa,CAAEC,MAAO,WAE7DP,OAAOC,eAAeb,EAAS,aAAc,CAAEmB,OAAO,KAQvDrB,EAAoBsB,EAAI,SAASD,EAAOE,GAEvC,GADU,EAAPA,IAAUF,EAAQrB,EAAoBqB,IAC/B,EAAPE,EAAU,OAAOF,EACpB,GAAW,EAAPE,GAA8B,iBAAVF,GAAsBA,GAASA,EAAMG,WAAY,OAAOH,EAChF,IAAII,EAAKX,OAAOY,OAAO,MAGvB,GAFA1B,EAAoBkB,EAAEO,GACtBX,OAAOC,eAAeU,EAAI,UAAW,CAAET,YAAY,EAAMK,MAAOA,IACtD,EAAPE,GAA4B,iBAATF,EAAmB,IAAI,IAAIM,KAAON,EAAOrB,EAAoBU,EAAEe,EAAIE,EAAK,SAASA,GAAO,OAAON,EAAMM,IAAQC,KAAK,KAAMD,IAC9I,OAAOF,GAIRzB,EAAoB6B,EAAI,SAAS1B,GAChC,IAAIS,EAAST,GAAUA,EAAOqB,WAC7B,WAAwB,OAAOrB,EAAgB,SAC/C,WAA8B,OAAOA,GAEtC,OADAH,EAAoBU,EAAEE,EAAQ,IAAKA,GAC5BA,GAIRZ,EAAoBa,EAAI,SAASiB,EAAQC,GAAY,OAAOjB,OAAOkB,UAAUC,eAAe1B,KAAKuB,EAAQC,IAGzG/B,EAAoBkC,EAAI,GAIjBlC,EAAoBA,EAAoBmC,EAAI,G,wCCpEtC,UAZf,WACE,MACMC,EAAM,MAAMC,KAAKC,SACvB,MAAO,KACE,CACLC,EAAGC,SAAUJ,EACbI,ECPS,MDQTJ\\",\\"file\\":\\"importExport.js\\",\\"sourcesContent\\":[\\" \\\\t// The module cache\\\\n \\\\tvar installedModules = {};\\\\n\\\\n \\\\t// The require function\\\\n \\\\tfunction __webpack_require__(moduleId) {\\\\n\\\\n \\\\t\\\\t// Check if module is in cache\\\\n \\\\t\\\\tif(installedModules[moduleId]) {\\\\n \\\\t\\\\t\\\\treturn installedModules[moduleId].exports;\\\\n \\\\t\\\\t}\\\\n \\\\t\\\\t// Create a new module (and put it into the cache)\\\\n \\\\t\\\\tvar module = installedModules[moduleId] = {\\\\n \\\\t\\\\t\\\\ti: moduleId,\\\\n \\\\t\\\\t\\\\tl: false,\\\\n \\\\t\\\\t\\\\texports: {}\\\\n \\\\t\\\\t};\\\\n\\\\n \\\\t\\\\t// Execute the module function\\\\n \\\\t\\\\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\\\\n\\\\n \\\\t\\\\t// Flag the module as loaded\\\\n \\\\t\\\\tmodule.l = true;\\\\n\\\\n \\\\t\\\\t// Return the exports of the module\\\\n \\\\t\\\\treturn module.exports;\\\\n \\\\t}\\\\n\\\\n\\\\n \\\\t// expose the modules object (__webpack_modules__)\\\\n \\\\t__webpack_require__.m = modules;\\\\n\\\\n \\\\t// expose the module cache\\\\n \\\\t__webpack_require__.c = installedModules;\\\\n\\\\n \\\\t// define getter function for harmony exports\\\\n \\\\t__webpack_require__.d = function(exports, name, getter) {\\\\n \\\\t\\\\tif(!__webpack_require__.o(exports, name)) {\\\\n \\\\t\\\\t\\\\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\\\\n \\\\t\\\\t}\\\\n \\\\t};\\\\n\\\\n \\\\t// define __esModule on exports\\\\n \\\\t__webpack_require__.r = function(exports) {\\\\n \\\\t\\\\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\\\\n \\\\t\\\\t\\\\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\\\\n \\\\t\\\\t}\\\\n \\\\t\\\\tObject.defineProperty(exports, '__esModule', { value: true });\\\\n \\\\t};\\\\n\\\\n \\\\t// create a fake namespace object\\\\n \\\\t// mode & 1: value is a module id, require it\\\\n \\\\t// mode & 2: merge all properties of value into the ns\\\\n \\\\t// mode & 4: return value when already ns object\\\\n \\\\t// mode & 8|1: behave like require\\\\n \\\\t__webpack_require__.t = function(value, mode) {\\\\n \\\\t\\\\tif(mode & 1) value = __webpack_require__(value);\\\\n \\\\t\\\\tif(mode & 8) return value;\\\\n \\\\t\\\\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\\\\n \\\\t\\\\tvar ns = Object.create(null);\\\\n \\\\t\\\\t__webpack_require__.r(ns);\\\\n \\\\t\\\\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\\\\n \\\\t\\\\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\\\\n \\\\t\\\\treturn ns;\\\\n \\\\t};\\\\n\\\\n \\\\t// getDefaultExport function for compatibility with non-harmony modules\\\\n \\\\t__webpack_require__.n = function(module) {\\\\n \\\\t\\\\tvar getter = module && module.__esModule ?\\\\n \\\\t\\\\t\\\\tfunction getDefault() { return module['default']; } :\\\\n \\\\t\\\\t\\\\tfunction getModuleExports() { return module; };\\\\n \\\\t\\\\t__webpack_require__.d(getter, 'a', getter);\\\\n \\\\t\\\\treturn getter;\\\\n \\\\t};\\\\n\\\\n \\\\t// Object.prototype.hasOwnProperty.call\\\\n \\\\t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\\\\n\\\\n \\\\t// __webpack_public_path__\\\\n \\\\t__webpack_require__.p = \\\\\\"\\\\\\";\\\\n\\\\n\\\\n \\\\t// Load entry module and return exports\\\\n \\\\treturn __webpack_require__(__webpack_require__.s = 3);\\\\n\\",\\"import foo, { bar } from './dep';\\\\n\\\\nfunction Foo() {\\\\n const b = foo;\\\\n const baz = \`baz\${Math.random()}\`;\\\\n return () => {\\\\n return {\\\\n a: b + bar + baz,\\\\n b,\\\\n baz,\\\\n };\\\\n };\\\\n}\\\\n\\\\nexport default Foo;\\\\n\\",\\"export const bar = 'bar';\\\\nexport default 'foo';\\\\n\\"],\\"sourceRoot\\":\\"\\"}", + "js.js": "!function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){\\"undefined\\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:\\"Module\\"}),Object.defineProperty(e,\\"__esModule\\",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&\\"object\\"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,\\"default\\",{enumerable:!0,value:e}),2&t&&\\"string\\"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,\\"a\\",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p=\\"\\",n(n.s=0)}([function(e,t){e.exports=function(){console.log(7)}}]); +//# sourceMappingURL=js.js.map", + "js.js.map": "{\\"version\\":3,\\"sources\\":[\\"webpack:///webpack/bootstrap\\",\\"webpack:///./test/fixtures/entry.js\\"],\\"names\\":[\\"installedModules\\",\\"__webpack_require__\\",\\"moduleId\\",\\"exports\\",\\"module\\",\\"i\\",\\"l\\",\\"modules\\",\\"call\\",\\"m\\",\\"c\\",\\"d\\",\\"name\\",\\"getter\\",\\"o\\",\\"Object\\",\\"defineProperty\\",\\"enumerable\\",\\"get\\",\\"r\\",\\"Symbol\\",\\"toStringTag\\",\\"value\\",\\"t\\",\\"mode\\",\\"__esModule\\",\\"ns\\",\\"create\\",\\"key\\",\\"bind\\",\\"n\\",\\"object\\",\\"property\\",\\"prototype\\",\\"hasOwnProperty\\",\\"p\\",\\"s\\",\\"console\\",\\"log\\",\\"b\\"],\\"mappings\\":\\"aACE,IAAIA,EAAmB,GAGvB,SAASC,EAAoBC,GAG5B,GAAGF,EAAiBE,GACnB,OAAOF,EAAiBE,GAAUC,QAGnC,IAAIC,EAASJ,EAAiBE,GAAY,CACzCG,EAAGH,EACHI,GAAG,EACHH,QAAS,IAUV,OANAI,EAAQL,GAAUM,KAAKJ,EAAOD,QAASC,EAAQA,EAAOD,QAASF,GAG/DG,EAAOE,GAAI,EAGJF,EAAOD,QAKfF,EAAoBQ,EAAIF,EAGxBN,EAAoBS,EAAIV,EAGxBC,EAAoBU,EAAI,SAASR,EAASS,EAAMC,GAC3CZ,EAAoBa,EAAEX,EAASS,IAClCG,OAAOC,eAAeb,EAASS,EAAM,CAAEK,YAAY,EAAMC,IAAKL,KAKhEZ,EAAoBkB,EAAI,SAAShB,GACX,oBAAXiB,QAA0BA,OAAOC,aAC1CN,OAAOC,eAAeb,EAASiB,OAAOC,YAAa,CAAEC,MAAO,WAE7DP,OAAOC,eAAeb,EAAS,aAAc,CAAEmB,OAAO,KAQvDrB,EAAoBsB,EAAI,SAASD,EAAOE,GAEvC,GADU,EAAPA,IAAUF,EAAQrB,EAAoBqB,IAC/B,EAAPE,EAAU,OAAOF,EACpB,GAAW,EAAPE,GAA8B,iBAAVF,GAAsBA,GAASA,EAAMG,WAAY,OAAOH,EAChF,IAAII,EAAKX,OAAOY,OAAO,MAGvB,GAFA1B,EAAoBkB,EAAEO,GACtBX,OAAOC,eAAeU,EAAI,UAAW,CAAET,YAAY,EAAMK,MAAOA,IACtD,EAAPE,GAA4B,iBAATF,EAAmB,IAAI,IAAIM,KAAON,EAAOrB,EAAoBU,EAAEe,EAAIE,EAAK,SAASA,GAAO,OAAON,EAAMM,IAAQC,KAAK,KAAMD,IAC9I,OAAOF,GAIRzB,EAAoB6B,EAAI,SAAS1B,GAChC,IAAIS,EAAST,GAAUA,EAAOqB,WAC7B,WAAwB,OAAOrB,EAAgB,SAC/C,WAA8B,OAAOA,GAEtC,OADAH,EAAoBU,EAAEE,EAAQ,IAAKA,GAC5BA,GAIRZ,EAAoBa,EAAI,SAASiB,EAAQC,GAAY,OAAOjB,OAAOkB,UAAUC,eAAe1B,KAAKuB,EAAQC,IAGzG/B,EAAoBkC,EAAI,GAIjBlC,EAAoBA,EAAoBmC,EAAI,G,gBC7ErDhC,EAAOD,QAAU,WAEfkC,QAAQC,IAAIC\\",\\"file\\":\\"js.js\\",\\"sourcesContent\\":[\\" \\\\t// The module cache\\\\n \\\\tvar installedModules = {};\\\\n\\\\n \\\\t// The require function\\\\n \\\\tfunction __webpack_require__(moduleId) {\\\\n\\\\n \\\\t\\\\t// Check if module is in cache\\\\n \\\\t\\\\tif(installedModules[moduleId]) {\\\\n \\\\t\\\\t\\\\treturn installedModules[moduleId].exports;\\\\n \\\\t\\\\t}\\\\n \\\\t\\\\t// Create a new module (and put it into the cache)\\\\n \\\\t\\\\tvar module = installedModules[moduleId] = {\\\\n \\\\t\\\\t\\\\ti: moduleId,\\\\n \\\\t\\\\t\\\\tl: false,\\\\n \\\\t\\\\t\\\\texports: {}\\\\n \\\\t\\\\t};\\\\n\\\\n \\\\t\\\\t// Execute the module function\\\\n \\\\t\\\\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\\\\n\\\\n \\\\t\\\\t// Flag the module as loaded\\\\n \\\\t\\\\tmodule.l = true;\\\\n\\\\n \\\\t\\\\t// Return the exports of the module\\\\n \\\\t\\\\treturn module.exports;\\\\n \\\\t}\\\\n\\\\n\\\\n \\\\t// expose the modules object (__webpack_modules__)\\\\n \\\\t__webpack_require__.m = modules;\\\\n\\\\n \\\\t// expose the module cache\\\\n \\\\t__webpack_require__.c = installedModules;\\\\n\\\\n \\\\t// define getter function for harmony exports\\\\n \\\\t__webpack_require__.d = function(exports, name, getter) {\\\\n \\\\t\\\\tif(!__webpack_require__.o(exports, name)) {\\\\n \\\\t\\\\t\\\\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\\\\n \\\\t\\\\t}\\\\n \\\\t};\\\\n\\\\n \\\\t// define __esModule on exports\\\\n \\\\t__webpack_require__.r = function(exports) {\\\\n \\\\t\\\\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\\\\n \\\\t\\\\t\\\\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\\\\n \\\\t\\\\t}\\\\n \\\\t\\\\tObject.defineProperty(exports, '__esModule', { value: true });\\\\n \\\\t};\\\\n\\\\n \\\\t// create a fake namespace object\\\\n \\\\t// mode & 1: value is a module id, require it\\\\n \\\\t// mode & 2: merge all properties of value into the ns\\\\n \\\\t// mode & 4: return value when already ns object\\\\n \\\\t// mode & 8|1: behave like require\\\\n \\\\t__webpack_require__.t = function(value, mode) {\\\\n \\\\t\\\\tif(mode & 1) value = __webpack_require__(value);\\\\n \\\\t\\\\tif(mode & 8) return value;\\\\n \\\\t\\\\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\\\\n \\\\t\\\\tvar ns = Object.create(null);\\\\n \\\\t\\\\t__webpack_require__.r(ns);\\\\n \\\\t\\\\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\\\\n \\\\t\\\\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\\\\n \\\\t\\\\treturn ns;\\\\n \\\\t};\\\\n\\\\n \\\\t// getDefaultExport function for compatibility with non-harmony modules\\\\n \\\\t__webpack_require__.n = function(module) {\\\\n \\\\t\\\\tvar getter = module && module.__esModule ?\\\\n \\\\t\\\\t\\\\tfunction getDefault() { return module['default']; } :\\\\n \\\\t\\\\t\\\\tfunction getModuleExports() { return module; };\\\\n \\\\t\\\\t__webpack_require__.d(getter, 'a', getter);\\\\n \\\\t\\\\treturn getter;\\\\n \\\\t};\\\\n\\\\n \\\\t// Object.prototype.hasOwnProperty.call\\\\n \\\\t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\\\\n\\\\n \\\\t// __webpack_public_path__\\\\n \\\\t__webpack_require__.p = \\\\\\"\\\\\\";\\\\n\\\\n\\\\n \\\\t// Load entry module and return exports\\\\n \\\\treturn __webpack_require__(__webpack_require__.s = 0);\\\\n\\",\\"// foo\\\\n/* @preserve*/\\\\n// bar\\\\nconst a = 2 + 2;\\\\n\\\\nmodule.exports = function Foo() {\\\\n const b = 2 + 2;\\\\n console.log(b + 1 + 2);\\\\n};\\\\n\\"],\\"sourceRoot\\":\\"\\"}", + "mjs.js": "!function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){\\"undefined\\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:\\"Module\\"}),Object.defineProperty(e,\\"__esModule\\",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&\\"object\\"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,\\"default\\",{enumerable:!0,value:e}),2&t&&\\"string\\"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,\\"a\\",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p=\\"\\",r(r.s=1)}([,function(e,t,r){\\"use strict\\";r.r(t);module.exports=function(){console.log(7)}}]); +//# sourceMappingURL=mjs.js.map", + "mjs.js.map": "{\\"version\\":3,\\"sources\\":[\\"webpack:///webpack/bootstrap\\",\\"webpack:///./test/fixtures/entry.mjs\\"],\\"names\\":[\\"installedModules\\",\\"__webpack_require__\\",\\"moduleId\\",\\"exports\\",\\"module\\",\\"i\\",\\"l\\",\\"modules\\",\\"call\\",\\"m\\",\\"c\\",\\"d\\",\\"name\\",\\"getter\\",\\"o\\",\\"Object\\",\\"defineProperty\\",\\"enumerable\\",\\"get\\",\\"r\\",\\"Symbol\\",\\"toStringTag\\",\\"value\\",\\"t\\",\\"mode\\",\\"__esModule\\",\\"ns\\",\\"create\\",\\"key\\",\\"bind\\",\\"n\\",\\"object\\",\\"property\\",\\"prototype\\",\\"hasOwnProperty\\",\\"p\\",\\"s\\",\\"console\\",\\"log\\",\\"b\\"],\\"mappings\\":\\"aACE,IAAIA,EAAmB,GAGvB,SAASC,EAAoBC,GAG5B,GAAGF,EAAiBE,GACnB,OAAOF,EAAiBE,GAAUC,QAGnC,IAAIC,EAASJ,EAAiBE,GAAY,CACzCG,EAAGH,EACHI,GAAG,EACHH,QAAS,IAUV,OANAI,EAAQL,GAAUM,KAAKJ,EAAOD,QAASC,EAAQA,EAAOD,QAASF,GAG/DG,EAAOE,GAAI,EAGJF,EAAOD,QAKfF,EAAoBQ,EAAIF,EAGxBN,EAAoBS,EAAIV,EAGxBC,EAAoBU,EAAI,SAASR,EAASS,EAAMC,GAC3CZ,EAAoBa,EAAEX,EAASS,IAClCG,OAAOC,eAAeb,EAASS,EAAM,CAAEK,YAAY,EAAMC,IAAKL,KAKhEZ,EAAoBkB,EAAI,SAAShB,GACX,oBAAXiB,QAA0BA,OAAOC,aAC1CN,OAAOC,eAAeb,EAASiB,OAAOC,YAAa,CAAEC,MAAO,WAE7DP,OAAOC,eAAeb,EAAS,aAAc,CAAEmB,OAAO,KAQvDrB,EAAoBsB,EAAI,SAASD,EAAOE,GAEvC,GADU,EAAPA,IAAUF,EAAQrB,EAAoBqB,IAC/B,EAAPE,EAAU,OAAOF,EACpB,GAAW,EAAPE,GAA8B,iBAAVF,GAAsBA,GAASA,EAAMG,WAAY,OAAOH,EAChF,IAAII,EAAKX,OAAOY,OAAO,MAGvB,GAFA1B,EAAoBkB,EAAEO,GACtBX,OAAOC,eAAeU,EAAI,UAAW,CAAET,YAAY,EAAMK,MAAOA,IACtD,EAAPE,GAA4B,iBAATF,EAAmB,IAAI,IAAIM,KAAON,EAAOrB,EAAoBU,EAAEe,EAAIE,EAAK,SAASA,GAAO,OAAON,EAAMM,IAAQC,KAAK,KAAMD,IAC9I,OAAOF,GAIRzB,EAAoB6B,EAAI,SAAS1B,GAChC,IAAIS,EAAST,GAAUA,EAAOqB,WAC7B,WAAwB,OAAOrB,EAAgB,SAC/C,WAA8B,OAAOA,GAEtC,OADAH,EAAoBU,EAAEE,EAAQ,IAAKA,GAC5BA,GAIRZ,EAAoBa,EAAI,SAASiB,EAAQC,GAAY,OAAOjB,OAAOkB,UAAUC,eAAe1B,KAAKuB,EAAQC,IAGzG/B,EAAoBkC,EAAI,GAIjBlC,EAAoBA,EAAoBmC,EAAI,G,gCClFrD,OAKAhC,OAAOD,QAAU,WAEfkC,QAAQC,IAAIC\\",\\"file\\":\\"mjs.js\\",\\"sourcesContent\\":[\\" \\\\t// The module cache\\\\n \\\\tvar installedModules = {};\\\\n\\\\n \\\\t// The require function\\\\n \\\\tfunction __webpack_require__(moduleId) {\\\\n\\\\n \\\\t\\\\t// Check if module is in cache\\\\n \\\\t\\\\tif(installedModules[moduleId]) {\\\\n \\\\t\\\\t\\\\treturn installedModules[moduleId].exports;\\\\n \\\\t\\\\t}\\\\n \\\\t\\\\t// Create a new module (and put it into the cache)\\\\n \\\\t\\\\tvar module = installedModules[moduleId] = {\\\\n \\\\t\\\\t\\\\ti: moduleId,\\\\n \\\\t\\\\t\\\\tl: false,\\\\n \\\\t\\\\t\\\\texports: {}\\\\n \\\\t\\\\t};\\\\n\\\\n \\\\t\\\\t// Execute the module function\\\\n \\\\t\\\\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\\\\n\\\\n \\\\t\\\\t// Flag the module as loaded\\\\n \\\\t\\\\tmodule.l = true;\\\\n\\\\n \\\\t\\\\t// Return the exports of the module\\\\n \\\\t\\\\treturn module.exports;\\\\n \\\\t}\\\\n\\\\n\\\\n \\\\t// expose the modules object (__webpack_modules__)\\\\n \\\\t__webpack_require__.m = modules;\\\\n\\\\n \\\\t// expose the module cache\\\\n \\\\t__webpack_require__.c = installedModules;\\\\n\\\\n \\\\t// define getter function for harmony exports\\\\n \\\\t__webpack_require__.d = function(exports, name, getter) {\\\\n \\\\t\\\\tif(!__webpack_require__.o(exports, name)) {\\\\n \\\\t\\\\t\\\\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\\\\n \\\\t\\\\t}\\\\n \\\\t};\\\\n\\\\n \\\\t// define __esModule on exports\\\\n \\\\t__webpack_require__.r = function(exports) {\\\\n \\\\t\\\\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\\\\n \\\\t\\\\t\\\\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\\\\n \\\\t\\\\t}\\\\n \\\\t\\\\tObject.defineProperty(exports, '__esModule', { value: true });\\\\n \\\\t};\\\\n\\\\n \\\\t// create a fake namespace object\\\\n \\\\t// mode & 1: value is a module id, require it\\\\n \\\\t// mode & 2: merge all properties of value into the ns\\\\n \\\\t// mode & 4: return value when already ns object\\\\n \\\\t// mode & 8|1: behave like require\\\\n \\\\t__webpack_require__.t = function(value, mode) {\\\\n \\\\t\\\\tif(mode & 1) value = __webpack_require__(value);\\\\n \\\\t\\\\tif(mode & 8) return value;\\\\n \\\\t\\\\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\\\\n \\\\t\\\\tvar ns = Object.create(null);\\\\n \\\\t\\\\t__webpack_require__.r(ns);\\\\n \\\\t\\\\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\\\\n \\\\t\\\\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\\\\n \\\\t\\\\treturn ns;\\\\n \\\\t};\\\\n\\\\n \\\\t// getDefaultExport function for compatibility with non-harmony modules\\\\n \\\\t__webpack_require__.n = function(module) {\\\\n \\\\t\\\\tvar getter = module && module.__esModule ?\\\\n \\\\t\\\\t\\\\tfunction getDefault() { return module['default']; } :\\\\n \\\\t\\\\t\\\\tfunction getModuleExports() { return module; };\\\\n \\\\t\\\\t__webpack_require__.d(getter, 'a', getter);\\\\n \\\\t\\\\treturn getter;\\\\n \\\\t};\\\\n\\\\n \\\\t// Object.prototype.hasOwnProperty.call\\\\n \\\\t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\\\\n\\\\n \\\\t// __webpack_public_path__\\\\n \\\\t__webpack_require__.p = \\\\\\"\\\\\\";\\\\n\\\\n\\\\n \\\\t// Load entry module and return exports\\\\n \\\\treturn __webpack_require__(__webpack_require__.s = 1);\\\\n\\",\\"// foo\\\\n/* @preserve*/\\\\n// bar\\\\nconst a = 2 + 2;\\\\n\\\\nmodule.exports = function Foo() {\\\\n const b = 2 + 2;\\\\n console.log(b + 1 + 2);\\\\n};\\\\n\\"],\\"sourceRoot\\":\\"\\"}", +} +`; + +exports[`TerserPlugin should work with source map and use memory cache when the "cache" option is "true": assets 2`] = ` +Object { + "4.4.js": "(window.webpackJsonp=window.webpackJsonp||[]).push([[4],{4:function(n,p,s){\\"use strict\\";s.r(p),p.default=\\"async-dep\\"}}]); +//# sourceMappingURL=4.4.js.map", + "4.4.js.map": "{\\"version\\":3,\\"sources\\":[\\"webpack:///./test/fixtures/async-import-export/async-dep.js\\"],\\"names\\":[],\\"mappings\\":\\"wFAAA,OAAe\\",\\"file\\":\\"4.4.js\\",\\"sourcesContent\\":[\\"export default \\\\\\"async-dep\\\\\\";\\\\n\\"],\\"sourceRoot\\":\\"\\"}", + "AsyncImportExport.js": "!function(e){function t(t){for(var r,o,u=t[0],i=t[1],a=0,l=[];a{console.log(\\"Good\\")}),t.default=\\"Awesome\\"}}); +//# sourceMappingURL=AsyncImportExport.js.map", + "AsyncImportExport.js.map": "{\\"version\\":3,\\"sources\\":[\\"webpack:///webpack/bootstrap\\",\\"webpack:///./test/fixtures/async-import-export/entry.js\\"],\\"names\\":[\\"webpackJsonpCallback\\",\\"data\\",\\"moduleId\\",\\"chunkId\\",\\"chunkIds\\",\\"moreModules\\",\\"i\\",\\"resolves\\",\\"length\\",\\"Object\\",\\"prototype\\",\\"hasOwnProperty\\",\\"call\\",\\"installedChunks\\",\\"push\\",\\"modules\\",\\"parentJsonpFunction\\",\\"shift\\",\\"installedModules\\",\\"0\\",\\"__webpack_require__\\",\\"exports\\",\\"module\\",\\"l\\",\\"e\\",\\"promises\\",\\"installedChunkData\\",\\"promise\\",\\"Promise\\",\\"resolve\\",\\"reject\\",\\"onScriptComplete\\",\\"script\\",\\"document\\",\\"createElement\\",\\"charset\\",\\"timeout\\",\\"nc\\",\\"setAttribute\\",\\"src\\",\\"p\\",\\"jsonpScriptSrc\\",\\"error\\",\\"Error\\",\\"event\\",\\"onerror\\",\\"onload\\",\\"clearTimeout\\",\\"chunk\\",\\"errorType\\",\\"type\\",\\"realSrc\\",\\"target\\",\\"message\\",\\"name\\",\\"request\\",\\"undefined\\",\\"setTimeout\\",\\"head\\",\\"appendChild\\",\\"all\\",\\"m\\",\\"c\\",\\"d\\",\\"getter\\",\\"o\\",\\"defineProperty\\",\\"enumerable\\",\\"get\\",\\"r\\",\\"Symbol\\",\\"toStringTag\\",\\"value\\",\\"t\\",\\"mode\\",\\"__esModule\\",\\"ns\\",\\"create\\",\\"key\\",\\"bind\\",\\"n\\",\\"object\\",\\"property\\",\\"oe\\",\\"err\\",\\"console\\",\\"jsonpArray\\",\\"window\\",\\"oldJsonpFunction\\",\\"slice\\",\\"s\\",\\"then\\",\\"log\\"],\\"mappings\\":\\"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\\",\\"file\\":\\"AsyncImportExport.js\\",\\"sourcesContent\\":[\\" \\\\t// install a JSONP callback for chunk loading\\\\n \\\\tfunction webpackJsonpCallback(data) {\\\\n \\\\t\\\\tvar chunkIds = data[0];\\\\n \\\\t\\\\tvar moreModules = data[1];\\\\n\\\\n\\\\n \\\\t\\\\t// add \\\\\\"moreModules\\\\\\" to the modules object,\\\\n \\\\t\\\\t// then flag all \\\\\\"chunkIds\\\\\\" as loaded and fire callback\\\\n \\\\t\\\\tvar moduleId, chunkId, i = 0, resolves = [];\\\\n \\\\t\\\\tfor(;i < chunkIds.length; i++) {\\\\n \\\\t\\\\t\\\\tchunkId = chunkIds[i];\\\\n \\\\t\\\\t\\\\tif(Object.prototype.hasOwnProperty.call(installedChunks, chunkId) && installedChunks[chunkId]) {\\\\n \\\\t\\\\t\\\\t\\\\tresolves.push(installedChunks[chunkId][0]);\\\\n \\\\t\\\\t\\\\t}\\\\n \\\\t\\\\t\\\\tinstalledChunks[chunkId] = 0;\\\\n \\\\t\\\\t}\\\\n \\\\t\\\\tfor(moduleId in moreModules) {\\\\n \\\\t\\\\t\\\\tif(Object.prototype.hasOwnProperty.call(moreModules, moduleId)) {\\\\n \\\\t\\\\t\\\\t\\\\tmodules[moduleId] = moreModules[moduleId];\\\\n \\\\t\\\\t\\\\t}\\\\n \\\\t\\\\t}\\\\n \\\\t\\\\tif(parentJsonpFunction) parentJsonpFunction(data);\\\\n\\\\n \\\\t\\\\twhile(resolves.length) {\\\\n \\\\t\\\\t\\\\tresolves.shift()();\\\\n \\\\t\\\\t}\\\\n\\\\n \\\\t};\\\\n\\\\n\\\\n \\\\t// The module cache\\\\n \\\\tvar installedModules = {};\\\\n\\\\n \\\\t// object to store loaded and loading chunks\\\\n \\\\t// undefined = chunk not loaded, null = chunk preloaded/prefetched\\\\n \\\\t// Promise = chunk loading, 0 = chunk loaded\\\\n \\\\tvar installedChunks = {\\\\n \\\\t\\\\t0: 0\\\\n \\\\t};\\\\n\\\\n\\\\n\\\\n \\\\t// script path function\\\\n \\\\tfunction jsonpScriptSrc(chunkId) {\\\\n \\\\t\\\\treturn __webpack_require__.p + \\\\\\"\\\\\\" + chunkId + \\\\\\".\\\\\\" + ({}[chunkId]||chunkId) + \\\\\\".js\\\\\\"\\\\n \\\\t}\\\\n\\\\n \\\\t// The require function\\\\n \\\\tfunction __webpack_require__(moduleId) {\\\\n\\\\n \\\\t\\\\t// Check if module is in cache\\\\n \\\\t\\\\tif(installedModules[moduleId]) {\\\\n \\\\t\\\\t\\\\treturn installedModules[moduleId].exports;\\\\n \\\\t\\\\t}\\\\n \\\\t\\\\t// Create a new module (and put it into the cache)\\\\n \\\\t\\\\tvar module = installedModules[moduleId] = {\\\\n \\\\t\\\\t\\\\ti: moduleId,\\\\n \\\\t\\\\t\\\\tl: false,\\\\n \\\\t\\\\t\\\\texports: {}\\\\n \\\\t\\\\t};\\\\n\\\\n \\\\t\\\\t// Execute the module function\\\\n \\\\t\\\\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\\\\n\\\\n \\\\t\\\\t// Flag the module as loaded\\\\n \\\\t\\\\tmodule.l = true;\\\\n\\\\n \\\\t\\\\t// Return the exports of the module\\\\n \\\\t\\\\treturn module.exports;\\\\n \\\\t}\\\\n\\\\n \\\\t// This file contains only the entry chunk.\\\\n \\\\t// The chunk loading function for additional chunks\\\\n \\\\t__webpack_require__.e = function requireEnsure(chunkId) {\\\\n \\\\t\\\\tvar promises = [];\\\\n\\\\n\\\\n \\\\t\\\\t// JSONP chunk loading for javascript\\\\n\\\\n \\\\t\\\\tvar installedChunkData = installedChunks[chunkId];\\\\n \\\\t\\\\tif(installedChunkData !== 0) { // 0 means \\\\\\"already installed\\\\\\".\\\\n\\\\n \\\\t\\\\t\\\\t// a Promise means \\\\\\"currently loading\\\\\\".\\\\n \\\\t\\\\t\\\\tif(installedChunkData) {\\\\n \\\\t\\\\t\\\\t\\\\tpromises.push(installedChunkData[2]);\\\\n \\\\t\\\\t\\\\t} else {\\\\n \\\\t\\\\t\\\\t\\\\t// setup Promise in chunk cache\\\\n \\\\t\\\\t\\\\t\\\\tvar promise = new Promise(function(resolve, reject) {\\\\n \\\\t\\\\t\\\\t\\\\t\\\\tinstalledChunkData = installedChunks[chunkId] = [resolve, reject];\\\\n \\\\t\\\\t\\\\t\\\\t});\\\\n \\\\t\\\\t\\\\t\\\\tpromises.push(installedChunkData[2] = promise);\\\\n\\\\n \\\\t\\\\t\\\\t\\\\t// start chunk loading\\\\n \\\\t\\\\t\\\\t\\\\tvar script = document.createElement('script');\\\\n \\\\t\\\\t\\\\t\\\\tvar onScriptComplete;\\\\n\\\\n \\\\t\\\\t\\\\t\\\\tscript.charset = 'utf-8';\\\\n \\\\t\\\\t\\\\t\\\\tscript.timeout = 120;\\\\n \\\\t\\\\t\\\\t\\\\tif (__webpack_require__.nc) {\\\\n \\\\t\\\\t\\\\t\\\\t\\\\tscript.setAttribute(\\\\\\"nonce\\\\\\", __webpack_require__.nc);\\\\n \\\\t\\\\t\\\\t\\\\t}\\\\n \\\\t\\\\t\\\\t\\\\tscript.src = jsonpScriptSrc(chunkId);\\\\n\\\\n \\\\t\\\\t\\\\t\\\\t// create error before stack unwound to get useful stacktrace later\\\\n \\\\t\\\\t\\\\t\\\\tvar error = new Error();\\\\n \\\\t\\\\t\\\\t\\\\tonScriptComplete = function (event) {\\\\n \\\\t\\\\t\\\\t\\\\t\\\\t// avoid mem leaks in IE.\\\\n \\\\t\\\\t\\\\t\\\\t\\\\tscript.onerror = script.onload = null;\\\\n \\\\t\\\\t\\\\t\\\\t\\\\tclearTimeout(timeout);\\\\n \\\\t\\\\t\\\\t\\\\t\\\\tvar chunk = installedChunks[chunkId];\\\\n \\\\t\\\\t\\\\t\\\\t\\\\tif(chunk !== 0) {\\\\n \\\\t\\\\t\\\\t\\\\t\\\\t\\\\tif(chunk) {\\\\n \\\\t\\\\t\\\\t\\\\t\\\\t\\\\t\\\\tvar errorType = event && (event.type === 'load' ? 'missing' : event.type);\\\\n \\\\t\\\\t\\\\t\\\\t\\\\t\\\\t\\\\tvar realSrc = event && event.target && event.target.src;\\\\n \\\\t\\\\t\\\\t\\\\t\\\\t\\\\t\\\\terror.message = 'Loading chunk ' + chunkId + ' failed.\\\\\\\\n(' + errorType + ': ' + realSrc + ')';\\\\n \\\\t\\\\t\\\\t\\\\t\\\\t\\\\t\\\\terror.name = 'ChunkLoadError';\\\\n \\\\t\\\\t\\\\t\\\\t\\\\t\\\\t\\\\terror.type = errorType;\\\\n \\\\t\\\\t\\\\t\\\\t\\\\t\\\\t\\\\terror.request = realSrc;\\\\n \\\\t\\\\t\\\\t\\\\t\\\\t\\\\t\\\\tchunk[1](error);\\\\n \\\\t\\\\t\\\\t\\\\t\\\\t\\\\t}\\\\n \\\\t\\\\t\\\\t\\\\t\\\\t\\\\tinstalledChunks[chunkId] = undefined;\\\\n \\\\t\\\\t\\\\t\\\\t\\\\t}\\\\n \\\\t\\\\t\\\\t\\\\t};\\\\n \\\\t\\\\t\\\\t\\\\tvar timeout = setTimeout(function(){\\\\n \\\\t\\\\t\\\\t\\\\t\\\\tonScriptComplete({ type: 'timeout', target: script });\\\\n \\\\t\\\\t\\\\t\\\\t}, 120000);\\\\n \\\\t\\\\t\\\\t\\\\tscript.onerror = script.onload = onScriptComplete;\\\\n \\\\t\\\\t\\\\t\\\\tdocument.head.appendChild(script);\\\\n \\\\t\\\\t\\\\t}\\\\n \\\\t\\\\t}\\\\n \\\\t\\\\treturn Promise.all(promises);\\\\n \\\\t};\\\\n\\\\n \\\\t// expose the modules object (__webpack_modules__)\\\\n \\\\t__webpack_require__.m = modules;\\\\n\\\\n \\\\t// expose the module cache\\\\n \\\\t__webpack_require__.c = installedModules;\\\\n\\\\n \\\\t// define getter function for harmony exports\\\\n \\\\t__webpack_require__.d = function(exports, name, getter) {\\\\n \\\\t\\\\tif(!__webpack_require__.o(exports, name)) {\\\\n \\\\t\\\\t\\\\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\\\\n \\\\t\\\\t}\\\\n \\\\t};\\\\n\\\\n \\\\t// define __esModule on exports\\\\n \\\\t__webpack_require__.r = function(exports) {\\\\n \\\\t\\\\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\\\\n \\\\t\\\\t\\\\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\\\\n \\\\t\\\\t}\\\\n \\\\t\\\\tObject.defineProperty(exports, '__esModule', { value: true });\\\\n \\\\t};\\\\n\\\\n \\\\t// create a fake namespace object\\\\n \\\\t// mode & 1: value is a module id, require it\\\\n \\\\t// mode & 2: merge all properties of value into the ns\\\\n \\\\t// mode & 4: return value when already ns object\\\\n \\\\t// mode & 8|1: behave like require\\\\n \\\\t__webpack_require__.t = function(value, mode) {\\\\n \\\\t\\\\tif(mode & 1) value = __webpack_require__(value);\\\\n \\\\t\\\\tif(mode & 8) return value;\\\\n \\\\t\\\\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\\\\n \\\\t\\\\tvar ns = Object.create(null);\\\\n \\\\t\\\\t__webpack_require__.r(ns);\\\\n \\\\t\\\\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\\\\n \\\\t\\\\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\\\\n \\\\t\\\\treturn ns;\\\\n \\\\t};\\\\n\\\\n \\\\t// getDefaultExport function for compatibility with non-harmony modules\\\\n \\\\t__webpack_require__.n = function(module) {\\\\n \\\\t\\\\tvar getter = module && module.__esModule ?\\\\n \\\\t\\\\t\\\\tfunction getDefault() { return module['default']; } :\\\\n \\\\t\\\\t\\\\tfunction getModuleExports() { return module; };\\\\n \\\\t\\\\t__webpack_require__.d(getter, 'a', getter);\\\\n \\\\t\\\\treturn getter;\\\\n \\\\t};\\\\n\\\\n \\\\t// Object.prototype.hasOwnProperty.call\\\\n \\\\t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\\\\n\\\\n \\\\t// __webpack_public_path__\\\\n \\\\t__webpack_require__.p = \\\\\\"\\\\\\";\\\\n\\\\n \\\\t// on error function for async loading\\\\n \\\\t__webpack_require__.oe = function(err) { console.error(err); throw err; };\\\\n\\\\n \\\\tvar jsonpArray = window[\\\\\\"webpackJsonp\\\\\\"] = window[\\\\\\"webpackJsonp\\\\\\"] || [];\\\\n \\\\tvar oldJsonpFunction = jsonpArray.push.bind(jsonpArray);\\\\n \\\\tjsonpArray.push = webpackJsonpCallback;\\\\n \\\\tjsonpArray = jsonpArray.slice();\\\\n \\\\tfor(var i = 0; i < jsonpArray.length; i++) webpackJsonpCallback(jsonpArray[i]);\\\\n \\\\tvar parentJsonpFunction = oldJsonpFunction;\\\\n\\\\n\\\\n \\\\t// Load entry module and return exports\\\\n \\\\treturn __webpack_require__(__webpack_require__.s = 2);\\\\n\\",\\"import(\\\\\\"./async-dep\\\\\\").then(() => {\\\\n console.log('Good')\\\\n});\\\\n\\\\nexport default \\\\\\"Awesome\\\\\\";\\\\n\\"],\\"sourceRoot\\":\\"\\"}", + "importExport.js": "!function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){\\"undefined\\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:\\"Module\\"}),Object.defineProperty(e,\\"__esModule\\",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&\\"object\\"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,\\"default\\",{enumerable:!0,value:e}),2&t&&\\"string\\"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,\\"a\\",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p=\\"\\",r(r.s=3)}({3:function(e,t,r){\\"use strict\\";r.r(t);t.default=function(){const e=\\"baz\\"+Math.random();return()=>({a:\\"foobar\\"+e,b:\\"foo\\",baz:e})}}}); +//# sourceMappingURL=importExport.js.map", + "importExport.js.map": "{\\"version\\":3,\\"sources\\":[\\"webpack:///webpack/bootstrap\\",\\"webpack:///./test/fixtures/import-export/entry.js\\",\\"webpack:///./test/fixtures/import-export/dep.js\\"],\\"names\\":[\\"installedModules\\",\\"__webpack_require__\\",\\"moduleId\\",\\"exports\\",\\"module\\",\\"i\\",\\"l\\",\\"modules\\",\\"call\\",\\"m\\",\\"c\\",\\"d\\",\\"name\\",\\"getter\\",\\"o\\",\\"Object\\",\\"defineProperty\\",\\"enumerable\\",\\"get\\",\\"r\\",\\"Symbol\\",\\"toStringTag\\",\\"value\\",\\"t\\",\\"mode\\",\\"__esModule\\",\\"ns\\",\\"create\\",\\"key\\",\\"bind\\",\\"n\\",\\"object\\",\\"property\\",\\"prototype\\",\\"hasOwnProperty\\",\\"p\\",\\"s\\",\\"baz\\",\\"Math\\",\\"random\\",\\"a\\",\\"b\\"],\\"mappings\\":\\"aACE,IAAIA,EAAmB,GAGvB,SAASC,EAAoBC,GAG5B,GAAGF,EAAiBE,GACnB,OAAOF,EAAiBE,GAAUC,QAGnC,IAAIC,EAASJ,EAAiBE,GAAY,CACzCG,EAAGH,EACHI,GAAG,EACHH,QAAS,IAUV,OANAI,EAAQL,GAAUM,KAAKJ,EAAOD,QAASC,EAAQA,EAAOD,QAASF,GAG/DG,EAAOE,GAAI,EAGJF,EAAOD,QAKfF,EAAoBQ,EAAIF,EAGxBN,EAAoBS,EAAIV,EAGxBC,EAAoBU,EAAI,SAASR,EAASS,EAAMC,GAC3CZ,EAAoBa,EAAEX,EAASS,IAClCG,OAAOC,eAAeb,EAASS,EAAM,CAAEK,YAAY,EAAMC,IAAKL,KAKhEZ,EAAoBkB,EAAI,SAAShB,GACX,oBAAXiB,QAA0BA,OAAOC,aAC1CN,OAAOC,eAAeb,EAASiB,OAAOC,YAAa,CAAEC,MAAO,WAE7DP,OAAOC,eAAeb,EAAS,aAAc,CAAEmB,OAAO,KAQvDrB,EAAoBsB,EAAI,SAASD,EAAOE,GAEvC,GADU,EAAPA,IAAUF,EAAQrB,EAAoBqB,IAC/B,EAAPE,EAAU,OAAOF,EACpB,GAAW,EAAPE,GAA8B,iBAAVF,GAAsBA,GAASA,EAAMG,WAAY,OAAOH,EAChF,IAAII,EAAKX,OAAOY,OAAO,MAGvB,GAFA1B,EAAoBkB,EAAEO,GACtBX,OAAOC,eAAeU,EAAI,UAAW,CAAET,YAAY,EAAMK,MAAOA,IACtD,EAAPE,GAA4B,iBAATF,EAAmB,IAAI,IAAIM,KAAON,EAAOrB,EAAoBU,EAAEe,EAAIE,EAAK,SAASA,GAAO,OAAON,EAAMM,IAAQC,KAAK,KAAMD,IAC9I,OAAOF,GAIRzB,EAAoB6B,EAAI,SAAS1B,GAChC,IAAIS,EAAST,GAAUA,EAAOqB,WAC7B,WAAwB,OAAOrB,EAAgB,SAC/C,WAA8B,OAAOA,GAEtC,OADAH,EAAoBU,EAAEE,EAAQ,IAAKA,GAC5BA,GAIRZ,EAAoBa,EAAI,SAASiB,EAAQC,GAAY,OAAOjB,OAAOkB,UAAUC,eAAe1B,KAAKuB,EAAQC,IAGzG/B,EAAoBkC,EAAI,GAIjBlC,EAAoBA,EAAoBmC,EAAI,G,wCCpEtC,UAZf,WACE,MACMC,EAAM,MAAMC,KAAKC,SACvB,MAAO,KACE,CACLC,EAAGC,SAAUJ,EACbI,ECPS,MDQTJ\\",\\"file\\":\\"importExport.js\\",\\"sourcesContent\\":[\\" \\\\t// The module cache\\\\n \\\\tvar installedModules = {};\\\\n\\\\n \\\\t// The require function\\\\n \\\\tfunction __webpack_require__(moduleId) {\\\\n\\\\n \\\\t\\\\t// Check if module is in cache\\\\n \\\\t\\\\tif(installedModules[moduleId]) {\\\\n \\\\t\\\\t\\\\treturn installedModules[moduleId].exports;\\\\n \\\\t\\\\t}\\\\n \\\\t\\\\t// Create a new module (and put it into the cache)\\\\n \\\\t\\\\tvar module = installedModules[moduleId] = {\\\\n \\\\t\\\\t\\\\ti: moduleId,\\\\n \\\\t\\\\t\\\\tl: false,\\\\n \\\\t\\\\t\\\\texports: {}\\\\n \\\\t\\\\t};\\\\n\\\\n \\\\t\\\\t// Execute the module function\\\\n \\\\t\\\\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\\\\n\\\\n \\\\t\\\\t// Flag the module as loaded\\\\n \\\\t\\\\tmodule.l = true;\\\\n\\\\n \\\\t\\\\t// Return the exports of the module\\\\n \\\\t\\\\treturn module.exports;\\\\n \\\\t}\\\\n\\\\n\\\\n \\\\t// expose the modules object (__webpack_modules__)\\\\n \\\\t__webpack_require__.m = modules;\\\\n\\\\n \\\\t// expose the module cache\\\\n \\\\t__webpack_require__.c = installedModules;\\\\n\\\\n \\\\t// define getter function for harmony exports\\\\n \\\\t__webpack_require__.d = function(exports, name, getter) {\\\\n \\\\t\\\\tif(!__webpack_require__.o(exports, name)) {\\\\n \\\\t\\\\t\\\\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\\\\n \\\\t\\\\t}\\\\n \\\\t};\\\\n\\\\n \\\\t// define __esModule on exports\\\\n \\\\t__webpack_require__.r = function(exports) {\\\\n \\\\t\\\\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\\\\n \\\\t\\\\t\\\\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\\\\n \\\\t\\\\t}\\\\n \\\\t\\\\tObject.defineProperty(exports, '__esModule', { value: true });\\\\n \\\\t};\\\\n\\\\n \\\\t// create a fake namespace object\\\\n \\\\t// mode & 1: value is a module id, require it\\\\n \\\\t// mode & 2: merge all properties of value into the ns\\\\n \\\\t// mode & 4: return value when already ns object\\\\n \\\\t// mode & 8|1: behave like require\\\\n \\\\t__webpack_require__.t = function(value, mode) {\\\\n \\\\t\\\\tif(mode & 1) value = __webpack_require__(value);\\\\n \\\\t\\\\tif(mode & 8) return value;\\\\n \\\\t\\\\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\\\\n \\\\t\\\\tvar ns = Object.create(null);\\\\n \\\\t\\\\t__webpack_require__.r(ns);\\\\n \\\\t\\\\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\\\\n \\\\t\\\\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\\\\n \\\\t\\\\treturn ns;\\\\n \\\\t};\\\\n\\\\n \\\\t// getDefaultExport function for compatibility with non-harmony modules\\\\n \\\\t__webpack_require__.n = function(module) {\\\\n \\\\t\\\\tvar getter = module && module.__esModule ?\\\\n \\\\t\\\\t\\\\tfunction getDefault() { return module['default']; } :\\\\n \\\\t\\\\t\\\\tfunction getModuleExports() { return module; };\\\\n \\\\t\\\\t__webpack_require__.d(getter, 'a', getter);\\\\n \\\\t\\\\treturn getter;\\\\n \\\\t};\\\\n\\\\n \\\\t// Object.prototype.hasOwnProperty.call\\\\n \\\\t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\\\\n\\\\n \\\\t// __webpack_public_path__\\\\n \\\\t__webpack_require__.p = \\\\\\"\\\\\\";\\\\n\\\\n\\\\n \\\\t// Load entry module and return exports\\\\n \\\\treturn __webpack_require__(__webpack_require__.s = 3);\\\\n\\",\\"import foo, { bar } from './dep';\\\\n\\\\nfunction Foo() {\\\\n const b = foo;\\\\n const baz = \`baz\${Math.random()}\`;\\\\n return () => {\\\\n return {\\\\n a: b + bar + baz,\\\\n b,\\\\n baz,\\\\n };\\\\n };\\\\n}\\\\n\\\\nexport default Foo;\\\\n\\",\\"export const bar = 'bar';\\\\nexport default 'foo';\\\\n\\"],\\"sourceRoot\\":\\"\\"}", + "js.js": "!function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){\\"undefined\\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:\\"Module\\"}),Object.defineProperty(e,\\"__esModule\\",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&\\"object\\"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,\\"default\\",{enumerable:!0,value:e}),2&t&&\\"string\\"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,\\"a\\",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p=\\"\\",n(n.s=0)}([function(e,t){e.exports=function(){console.log(7)}}]); +//# sourceMappingURL=js.js.map", + "js.js.map": "{\\"version\\":3,\\"sources\\":[\\"webpack:///webpack/bootstrap\\",\\"webpack:///./test/fixtures/entry.js\\"],\\"names\\":[\\"installedModules\\",\\"__webpack_require__\\",\\"moduleId\\",\\"exports\\",\\"module\\",\\"i\\",\\"l\\",\\"modules\\",\\"call\\",\\"m\\",\\"c\\",\\"d\\",\\"name\\",\\"getter\\",\\"o\\",\\"Object\\",\\"defineProperty\\",\\"enumerable\\",\\"get\\",\\"r\\",\\"Symbol\\",\\"toStringTag\\",\\"value\\",\\"t\\",\\"mode\\",\\"__esModule\\",\\"ns\\",\\"create\\",\\"key\\",\\"bind\\",\\"n\\",\\"object\\",\\"property\\",\\"prototype\\",\\"hasOwnProperty\\",\\"p\\",\\"s\\",\\"console\\",\\"log\\",\\"b\\"],\\"mappings\\":\\"aACE,IAAIA,EAAmB,GAGvB,SAASC,EAAoBC,GAG5B,GAAGF,EAAiBE,GACnB,OAAOF,EAAiBE,GAAUC,QAGnC,IAAIC,EAASJ,EAAiBE,GAAY,CACzCG,EAAGH,EACHI,GAAG,EACHH,QAAS,IAUV,OANAI,EAAQL,GAAUM,KAAKJ,EAAOD,QAASC,EAAQA,EAAOD,QAASF,GAG/DG,EAAOE,GAAI,EAGJF,EAAOD,QAKfF,EAAoBQ,EAAIF,EAGxBN,EAAoBS,EAAIV,EAGxBC,EAAoBU,EAAI,SAASR,EAASS,EAAMC,GAC3CZ,EAAoBa,EAAEX,EAASS,IAClCG,OAAOC,eAAeb,EAASS,EAAM,CAAEK,YAAY,EAAMC,IAAKL,KAKhEZ,EAAoBkB,EAAI,SAAShB,GACX,oBAAXiB,QAA0BA,OAAOC,aAC1CN,OAAOC,eAAeb,EAASiB,OAAOC,YAAa,CAAEC,MAAO,WAE7DP,OAAOC,eAAeb,EAAS,aAAc,CAAEmB,OAAO,KAQvDrB,EAAoBsB,EAAI,SAASD,EAAOE,GAEvC,GADU,EAAPA,IAAUF,EAAQrB,EAAoBqB,IAC/B,EAAPE,EAAU,OAAOF,EACpB,GAAW,EAAPE,GAA8B,iBAAVF,GAAsBA,GAASA,EAAMG,WAAY,OAAOH,EAChF,IAAII,EAAKX,OAAOY,OAAO,MAGvB,GAFA1B,EAAoBkB,EAAEO,GACtBX,OAAOC,eAAeU,EAAI,UAAW,CAAET,YAAY,EAAMK,MAAOA,IACtD,EAAPE,GAA4B,iBAATF,EAAmB,IAAI,IAAIM,KAAON,EAAOrB,EAAoBU,EAAEe,EAAIE,EAAK,SAASA,GAAO,OAAON,EAAMM,IAAQC,KAAK,KAAMD,IAC9I,OAAOF,GAIRzB,EAAoB6B,EAAI,SAAS1B,GAChC,IAAIS,EAAST,GAAUA,EAAOqB,WAC7B,WAAwB,OAAOrB,EAAgB,SAC/C,WAA8B,OAAOA,GAEtC,OADAH,EAAoBU,EAAEE,EAAQ,IAAKA,GAC5BA,GAIRZ,EAAoBa,EAAI,SAASiB,EAAQC,GAAY,OAAOjB,OAAOkB,UAAUC,eAAe1B,KAAKuB,EAAQC,IAGzG/B,EAAoBkC,EAAI,GAIjBlC,EAAoBA,EAAoBmC,EAAI,G,gBC7ErDhC,EAAOD,QAAU,WAEfkC,QAAQC,IAAIC\\",\\"file\\":\\"js.js\\",\\"sourcesContent\\":[\\" \\\\t// The module cache\\\\n \\\\tvar installedModules = {};\\\\n\\\\n \\\\t// The require function\\\\n \\\\tfunction __webpack_require__(moduleId) {\\\\n\\\\n \\\\t\\\\t// Check if module is in cache\\\\n \\\\t\\\\tif(installedModules[moduleId]) {\\\\n \\\\t\\\\t\\\\treturn installedModules[moduleId].exports;\\\\n \\\\t\\\\t}\\\\n \\\\t\\\\t// Create a new module (and put it into the cache)\\\\n \\\\t\\\\tvar module = installedModules[moduleId] = {\\\\n \\\\t\\\\t\\\\ti: moduleId,\\\\n \\\\t\\\\t\\\\tl: false,\\\\n \\\\t\\\\t\\\\texports: {}\\\\n \\\\t\\\\t};\\\\n\\\\n \\\\t\\\\t// Execute the module function\\\\n \\\\t\\\\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\\\\n\\\\n \\\\t\\\\t// Flag the module as loaded\\\\n \\\\t\\\\tmodule.l = true;\\\\n\\\\n \\\\t\\\\t// Return the exports of the module\\\\n \\\\t\\\\treturn module.exports;\\\\n \\\\t}\\\\n\\\\n\\\\n \\\\t// expose the modules object (__webpack_modules__)\\\\n \\\\t__webpack_require__.m = modules;\\\\n\\\\n \\\\t// expose the module cache\\\\n \\\\t__webpack_require__.c = installedModules;\\\\n\\\\n \\\\t// define getter function for harmony exports\\\\n \\\\t__webpack_require__.d = function(exports, name, getter) {\\\\n \\\\t\\\\tif(!__webpack_require__.o(exports, name)) {\\\\n \\\\t\\\\t\\\\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\\\\n \\\\t\\\\t}\\\\n \\\\t};\\\\n\\\\n \\\\t// define __esModule on exports\\\\n \\\\t__webpack_require__.r = function(exports) {\\\\n \\\\t\\\\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\\\\n \\\\t\\\\t\\\\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\\\\n \\\\t\\\\t}\\\\n \\\\t\\\\tObject.defineProperty(exports, '__esModule', { value: true });\\\\n \\\\t};\\\\n\\\\n \\\\t// create a fake namespace object\\\\n \\\\t// mode & 1: value is a module id, require it\\\\n \\\\t// mode & 2: merge all properties of value into the ns\\\\n \\\\t// mode & 4: return value when already ns object\\\\n \\\\t// mode & 8|1: behave like require\\\\n \\\\t__webpack_require__.t = function(value, mode) {\\\\n \\\\t\\\\tif(mode & 1) value = __webpack_require__(value);\\\\n \\\\t\\\\tif(mode & 8) return value;\\\\n \\\\t\\\\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\\\\n \\\\t\\\\tvar ns = Object.create(null);\\\\n \\\\t\\\\t__webpack_require__.r(ns);\\\\n \\\\t\\\\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\\\\n \\\\t\\\\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\\\\n \\\\t\\\\treturn ns;\\\\n \\\\t};\\\\n\\\\n \\\\t// getDefaultExport function for compatibility with non-harmony modules\\\\n \\\\t__webpack_require__.n = function(module) {\\\\n \\\\t\\\\tvar getter = module && module.__esModule ?\\\\n \\\\t\\\\t\\\\tfunction getDefault() { return module['default']; } :\\\\n \\\\t\\\\t\\\\tfunction getModuleExports() { return module; };\\\\n \\\\t\\\\t__webpack_require__.d(getter, 'a', getter);\\\\n \\\\t\\\\treturn getter;\\\\n \\\\t};\\\\n\\\\n \\\\t// Object.prototype.hasOwnProperty.call\\\\n \\\\t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\\\\n\\\\n \\\\t// __webpack_public_path__\\\\n \\\\t__webpack_require__.p = \\\\\\"\\\\\\";\\\\n\\\\n\\\\n \\\\t// Load entry module and return exports\\\\n \\\\treturn __webpack_require__(__webpack_require__.s = 0);\\\\n\\",\\"// foo\\\\n/* @preserve*/\\\\n// bar\\\\nconst a = 2 + 2;\\\\n\\\\nmodule.exports = function Foo() {\\\\n const b = 2 + 2;\\\\n console.log(b + 1 + 2);\\\\n};\\\\n\\"],\\"sourceRoot\\":\\"\\"}", + "mjs.js": "!function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){\\"undefined\\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:\\"Module\\"}),Object.defineProperty(e,\\"__esModule\\",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&\\"object\\"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,\\"default\\",{enumerable:!0,value:e}),2&t&&\\"string\\"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,\\"a\\",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p=\\"\\",r(r.s=1)}([,function(e,t,r){\\"use strict\\";r.r(t);module.exports=function(){console.log(7)}}]); +//# sourceMappingURL=mjs.js.map", + "mjs.js.map": "{\\"version\\":3,\\"sources\\":[\\"webpack:///webpack/bootstrap\\",\\"webpack:///./test/fixtures/entry.mjs\\"],\\"names\\":[\\"installedModules\\",\\"__webpack_require__\\",\\"moduleId\\",\\"exports\\",\\"module\\",\\"i\\",\\"l\\",\\"modules\\",\\"call\\",\\"m\\",\\"c\\",\\"d\\",\\"name\\",\\"getter\\",\\"o\\",\\"Object\\",\\"defineProperty\\",\\"enumerable\\",\\"get\\",\\"r\\",\\"Symbol\\",\\"toStringTag\\",\\"value\\",\\"t\\",\\"mode\\",\\"__esModule\\",\\"ns\\",\\"create\\",\\"key\\",\\"bind\\",\\"n\\",\\"object\\",\\"property\\",\\"prototype\\",\\"hasOwnProperty\\",\\"p\\",\\"s\\",\\"console\\",\\"log\\",\\"b\\"],\\"mappings\\":\\"aACE,IAAIA,EAAmB,GAGvB,SAASC,EAAoBC,GAG5B,GAAGF,EAAiBE,GACnB,OAAOF,EAAiBE,GAAUC,QAGnC,IAAIC,EAASJ,EAAiBE,GAAY,CACzCG,EAAGH,EACHI,GAAG,EACHH,QAAS,IAUV,OANAI,EAAQL,GAAUM,KAAKJ,EAAOD,QAASC,EAAQA,EAAOD,QAASF,GAG/DG,EAAOE,GAAI,EAGJF,EAAOD,QAKfF,EAAoBQ,EAAIF,EAGxBN,EAAoBS,EAAIV,EAGxBC,EAAoBU,EAAI,SAASR,EAASS,EAAMC,GAC3CZ,EAAoBa,EAAEX,EAASS,IAClCG,OAAOC,eAAeb,EAASS,EAAM,CAAEK,YAAY,EAAMC,IAAKL,KAKhEZ,EAAoBkB,EAAI,SAAShB,GACX,oBAAXiB,QAA0BA,OAAOC,aAC1CN,OAAOC,eAAeb,EAASiB,OAAOC,YAAa,CAAEC,MAAO,WAE7DP,OAAOC,eAAeb,EAAS,aAAc,CAAEmB,OAAO,KAQvDrB,EAAoBsB,EAAI,SAASD,EAAOE,GAEvC,GADU,EAAPA,IAAUF,EAAQrB,EAAoBqB,IAC/B,EAAPE,EAAU,OAAOF,EACpB,GAAW,EAAPE,GAA8B,iBAAVF,GAAsBA,GAASA,EAAMG,WAAY,OAAOH,EAChF,IAAII,EAAKX,OAAOY,OAAO,MAGvB,GAFA1B,EAAoBkB,EAAEO,GACtBX,OAAOC,eAAeU,EAAI,UAAW,CAAET,YAAY,EAAMK,MAAOA,IACtD,EAAPE,GAA4B,iBAATF,EAAmB,IAAI,IAAIM,KAAON,EAAOrB,EAAoBU,EAAEe,EAAIE,EAAK,SAASA,GAAO,OAAON,EAAMM,IAAQC,KAAK,KAAMD,IAC9I,OAAOF,GAIRzB,EAAoB6B,EAAI,SAAS1B,GAChC,IAAIS,EAAST,GAAUA,EAAOqB,WAC7B,WAAwB,OAAOrB,EAAgB,SAC/C,WAA8B,OAAOA,GAEtC,OADAH,EAAoBU,EAAEE,EAAQ,IAAKA,GAC5BA,GAIRZ,EAAoBa,EAAI,SAASiB,EAAQC,GAAY,OAAOjB,OAAOkB,UAAUC,eAAe1B,KAAKuB,EAAQC,IAGzG/B,EAAoBkC,EAAI,GAIjBlC,EAAoBA,EAAoBmC,EAAI,G,gCClFrD,OAKAhC,OAAOD,QAAU,WAEfkC,QAAQC,IAAIC\\",\\"file\\":\\"mjs.js\\",\\"sourcesContent\\":[\\" \\\\t// The module cache\\\\n \\\\tvar installedModules = {};\\\\n\\\\n \\\\t// The require function\\\\n \\\\tfunction __webpack_require__(moduleId) {\\\\n\\\\n \\\\t\\\\t// Check if module is in cache\\\\n \\\\t\\\\tif(installedModules[moduleId]) {\\\\n \\\\t\\\\t\\\\treturn installedModules[moduleId].exports;\\\\n \\\\t\\\\t}\\\\n \\\\t\\\\t// Create a new module (and put it into the cache)\\\\n \\\\t\\\\tvar module = installedModules[moduleId] = {\\\\n \\\\t\\\\t\\\\ti: moduleId,\\\\n \\\\t\\\\t\\\\tl: false,\\\\n \\\\t\\\\t\\\\texports: {}\\\\n \\\\t\\\\t};\\\\n\\\\n \\\\t\\\\t// Execute the module function\\\\n \\\\t\\\\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\\\\n\\\\n \\\\t\\\\t// Flag the module as loaded\\\\n \\\\t\\\\tmodule.l = true;\\\\n\\\\n \\\\t\\\\t// Return the exports of the module\\\\n \\\\t\\\\treturn module.exports;\\\\n \\\\t}\\\\n\\\\n\\\\n \\\\t// expose the modules object (__webpack_modules__)\\\\n \\\\t__webpack_require__.m = modules;\\\\n\\\\n \\\\t// expose the module cache\\\\n \\\\t__webpack_require__.c = installedModules;\\\\n\\\\n \\\\t// define getter function for harmony exports\\\\n \\\\t__webpack_require__.d = function(exports, name, getter) {\\\\n \\\\t\\\\tif(!__webpack_require__.o(exports, name)) {\\\\n \\\\t\\\\t\\\\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\\\\n \\\\t\\\\t}\\\\n \\\\t};\\\\n\\\\n \\\\t// define __esModule on exports\\\\n \\\\t__webpack_require__.r = function(exports) {\\\\n \\\\t\\\\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\\\\n \\\\t\\\\t\\\\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\\\\n \\\\t\\\\t}\\\\n \\\\t\\\\tObject.defineProperty(exports, '__esModule', { value: true });\\\\n \\\\t};\\\\n\\\\n \\\\t// create a fake namespace object\\\\n \\\\t// mode & 1: value is a module id, require it\\\\n \\\\t// mode & 2: merge all properties of value into the ns\\\\n \\\\t// mode & 4: return value when already ns object\\\\n \\\\t// mode & 8|1: behave like require\\\\n \\\\t__webpack_require__.t = function(value, mode) {\\\\n \\\\t\\\\tif(mode & 1) value = __webpack_require__(value);\\\\n \\\\t\\\\tif(mode & 8) return value;\\\\n \\\\t\\\\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\\\\n \\\\t\\\\tvar ns = Object.create(null);\\\\n \\\\t\\\\t__webpack_require__.r(ns);\\\\n \\\\t\\\\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\\\\n \\\\t\\\\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\\\\n \\\\t\\\\treturn ns;\\\\n \\\\t};\\\\n\\\\n \\\\t// getDefaultExport function for compatibility with non-harmony modules\\\\n \\\\t__webpack_require__.n = function(module) {\\\\n \\\\t\\\\tvar getter = module && module.__esModule ?\\\\n \\\\t\\\\t\\\\tfunction getDefault() { return module['default']; } :\\\\n \\\\t\\\\t\\\\tfunction getModuleExports() { return module; };\\\\n \\\\t\\\\t__webpack_require__.d(getter, 'a', getter);\\\\n \\\\t\\\\treturn getter;\\\\n \\\\t};\\\\n\\\\n \\\\t// Object.prototype.hasOwnProperty.call\\\\n \\\\t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\\\\n\\\\n \\\\t// __webpack_public_path__\\\\n \\\\t__webpack_require__.p = \\\\\\"\\\\\\";\\\\n\\\\n\\\\n \\\\t// Load entry module and return exports\\\\n \\\\treturn __webpack_require__(__webpack_require__.s = 1);\\\\n\\",\\"// foo\\\\n/* @preserve*/\\\\n// bar\\\\nconst a = 2 + 2;\\\\n\\\\nmodule.exports = function Foo() {\\\\n const b = 2 + 2;\\\\n console.log(b + 1 + 2);\\\\n};\\\\n\\"],\\"sourceRoot\\":\\"\\"}", +} +`; + +exports[`TerserPlugin should work with source map and use memory cache when the "cache" option is "true": errors 1`] = `Array []`; + +exports[`TerserPlugin should work with source map and use memory cache when the "cache" option is "true": errors 2`] = `Array []`; + +exports[`TerserPlugin should work with source map and use memory cache when the "cache" option is "true": warnings 1`] = `Array []`; + +exports[`TerserPlugin should work with source map and use memory cache when the "cache" option is "true": warnings 2`] = `Array []`; + +exports[`TerserPlugin should work, extract comments in different files and use memory cache memory cache when the "cache" option is "true" and the asset has been changed: assets 1`] = ` +Object { + "4.4.js": "/*! For license information please see 4.4.js.LICENSE.txt */ +(window.webpackJsonp=window.webpackJsonp||[]).push([[4],{4:function(n,o){n.exports=Math.random()}}]);", + "4.4.js.LICENSE.txt": "/*! Legal Comment */ + +/** @license Copyright 2112 Moon. **/ +", + "four.js": "/*! For license information please see four.js.LICENSE.txt */ +!function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){\\"undefined\\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:\\"Module\\"}),Object.defineProperty(e,\\"__esModule\\",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&\\"object\\"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,\\"default\\",{enumerable:!0,value:e}),2&t&&\\"string\\"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,\\"a\\",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p=\\"\\",r(r.s=3)}({3:function(e,t){e.exports=Math.random()}});", + "four.js.LICENSE.txt": "/** + * Duplicate comment in difference files. + * @license MIT + */ +", + "one.js": "/*! For license information please see one.js.LICENSE.txt */ +!function(e){function t(t){for(var r,o,u=t[0],i=t[1],a=0,l=[];a{\\"use strict\\";p.r(s),p.d(s,{default:()=>c});const c=\\"async-dep\\"}}]);", + "AsyncImportExport.js": "(()=>{\\"use strict\\";var e,r,t={},o={};function n(e){if(o[e])return o[e].exports;var r=o[e]={exports:{}};return t[e](r,r.exports,n),r.exports}n.m=t,n.d=(e,r)=>{for(var t in r)n.o(r,t)&&!n.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:r[t]})},n.f={},n.e=e=>Promise.all(Object.keys(n.f).reduce((r,t)=>(n.f[t](e,r),r),[])),n.u=e=>e+\\".\\"+e+\\".js\\",n.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),e={},r=\\"terser-webpack-plugin:\\",n.l=(t,o,a)=>{if(e[t])e[t].push(o);else{var i,l;if(void 0!==a)for(var u=document.getElementsByTagName(\\"script\\"),s=0;s{i.onerror=i.onload=null,clearTimeout(c);var n=e[t];if(delete e[t],i.parentNode&&i.parentNode.removeChild(i),n&&n.forEach(e=>e(o)),r)return r(o)},c=setTimeout(d.bind(null,void 0,{type:\\"timeout\\",target:i}),12e4);i.onerror=d.bind(null,i.onerror),i.onload=d.bind(null,i.onload),l&&document.head.appendChild(i)}},n.r=e=>{\\"undefined\\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:\\"Module\\"}),Object.defineProperty(e,\\"__esModule\\",{value:!0})},n.p=\\"\\",(()=>{var e={988:0};n.f.j=(r,t)=>{var o=n.o(e,r)?e[r]:void 0;if(0!==o)if(o)t.push(o[2]);else{var a=new Promise((t,n)=>{o=e[r]=[t,n]});t.push(o[2]=a);var i=n.p+n.u(r),l=new Error;n.l(i,t=>{if(n.o(e,r)&&(0!==(o=e[r])&&(e[r]=void 0),o)){var a=t&&(\\"load\\"===t.type?\\"missing\\":t.type),i=t&&t.target&&t.target.src;l.message=\\"Loading chunk \\"+r+\\" failed.\\\\n(\\"+a+\\": \\"+i+\\")\\",l.name=\\"ChunkLoadError\\",l.type=a,l.request=i,o[1](l)}},\\"chunk-\\"+r)}};var r=self.webpackChunkterser_webpack_plugin=self.webpackChunkterser_webpack_plugin||[],t=r.push.bind(r);r.push=r=>{for(var o,a,[i,l,u]=r,s=0,p=[];s{console.log(\\"Good\\")})})();", + "importExport.js": "(()=>{\\"use strict\\"})();", + "js.js": "(()=>{var r={791:r=>{r.exports=function(){console.log(7)}}},o={};!function t(e){if(o[e])return o[e].exports;var n=o[e]={exports:{}};return r[e](n,n.exports,t),n.exports}(791)})();", + "mjs.js": "(()=>{var r={631:r=>{r.exports=function(){console.log(7)}}},o={};!function t(e){if(o[e])return o[e].exports;var n=o[e]={exports:{}};return r[e](n,n.exports,t),n.exports}(631)})();", +} +`; + +exports[`TerserPlugin should work and do not use memory cache when the "cache" option is "false": assets 2`] = ` +Object { + "598.598.js": "(self.webpackChunkterser_webpack_plugin=self.webpackChunkterser_webpack_plugin||[]).push([[598],{598:(e,s,p)=>{\\"use strict\\";p.r(s),p.d(s,{default:()=>c});const c=\\"async-dep\\"}}]);", + "AsyncImportExport.js": "(()=>{\\"use strict\\";var e,r,t={},o={};function n(e){if(o[e])return o[e].exports;var r=o[e]={exports:{}};return t[e](r,r.exports,n),r.exports}n.m=t,n.d=(e,r)=>{for(var t in r)n.o(r,t)&&!n.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:r[t]})},n.f={},n.e=e=>Promise.all(Object.keys(n.f).reduce((r,t)=>(n.f[t](e,r),r),[])),n.u=e=>e+\\".\\"+e+\\".js\\",n.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),e={},r=\\"terser-webpack-plugin:\\",n.l=(t,o,a)=>{if(e[t])e[t].push(o);else{var i,l;if(void 0!==a)for(var u=document.getElementsByTagName(\\"script\\"),s=0;s{i.onerror=i.onload=null,clearTimeout(c);var n=e[t];if(delete e[t],i.parentNode&&i.parentNode.removeChild(i),n&&n.forEach(e=>e(o)),r)return r(o)},c=setTimeout(d.bind(null,void 0,{type:\\"timeout\\",target:i}),12e4);i.onerror=d.bind(null,i.onerror),i.onload=d.bind(null,i.onload),l&&document.head.appendChild(i)}},n.r=e=>{\\"undefined\\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:\\"Module\\"}),Object.defineProperty(e,\\"__esModule\\",{value:!0})},n.p=\\"\\",(()=>{var e={988:0};n.f.j=(r,t)=>{var o=n.o(e,r)?e[r]:void 0;if(0!==o)if(o)t.push(o[2]);else{var a=new Promise((t,n)=>{o=e[r]=[t,n]});t.push(o[2]=a);var i=n.p+n.u(r),l=new Error;n.l(i,t=>{if(n.o(e,r)&&(0!==(o=e[r])&&(e[r]=void 0),o)){var a=t&&(\\"load\\"===t.type?\\"missing\\":t.type),i=t&&t.target&&t.target.src;l.message=\\"Loading chunk \\"+r+\\" failed.\\\\n(\\"+a+\\": \\"+i+\\")\\",l.name=\\"ChunkLoadError\\",l.type=a,l.request=i,o[1](l)}},\\"chunk-\\"+r)}};var r=self.webpackChunkterser_webpack_plugin=self.webpackChunkterser_webpack_plugin||[],t=r.push.bind(r);r.push=r=>{for(var o,a,[i,l,u]=r,s=0,p=[];s{console.log(\\"Good\\")})})();", + "importExport.js": "(()=>{\\"use strict\\"})();", + "js.js": "(()=>{var r={791:r=>{r.exports=function(){console.log(7)}}},o={};!function t(e){if(o[e])return o[e].exports;var n=o[e]={exports:{}};return r[e](n,n.exports,t),n.exports}(791)})();", + "mjs.js": "(()=>{var r={631:r=>{r.exports=function(){console.log(7)}}},o={};!function t(e){if(o[e])return o[e].exports;var n=o[e]={exports:{}};return r[e](n,n.exports,t),n.exports}(631)})();", +} +`; + +exports[`TerserPlugin should work and do not use memory cache when the "cache" option is "false": errors 1`] = `Array []`; + +exports[`TerserPlugin should work and do not use memory cache when the "cache" option is "false": errors 2`] = `Array []`; + +exports[`TerserPlugin should work and do not use memory cache when the "cache" option is "false": warnings 1`] = `Array []`; + +exports[`TerserPlugin should work and do not use memory cache when the "cache" option is "false": warnings 2`] = `Array []`; + exports[`TerserPlugin should work and generate real content hash: assets 1`] = ` Object { "598.d955a8689b2acafd4711.905223c9dd9e6923fb56.1b79a24794e8f6aece1a.js": "(self.webpackChunkterser_webpack_plugin=self.webpackChunkterser_webpack_plugin||[]).push([[598],{598:(e,s,p)=>{\\"use strict\\";p.r(s),p.d(s,{default:()=>c});const c=\\"async-dep\\"}}]);", @@ -155,6 +183,62 @@ exports[`TerserPlugin should work and show related assets in stats: errors 1`] = exports[`TerserPlugin should work and show related assets in stats: warnings 1`] = `Array []`; +exports[`TerserPlugin should work and use memory cache when the "cache" option is "true" and the asset has been changed: assets 1`] = ` +Object { + "598.598.js": "(self.webpackChunkterser_webpack_plugin=self.webpackChunkterser_webpack_plugin||[]).push([[598],{598:(e,s,p)=>{\\"use strict\\";p.r(s),p.d(s,{default:()=>c});const c=\\"async-dep\\"}}]);", + "AsyncImportExport.js": "(()=>{\\"use strict\\";var e,r,t={},o={};function n(e){if(o[e])return o[e].exports;var r=o[e]={exports:{}};return t[e](r,r.exports,n),r.exports}n.m=t,n.d=(e,r)=>{for(var t in r)n.o(r,t)&&!n.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:r[t]})},n.f={},n.e=e=>Promise.all(Object.keys(n.f).reduce((r,t)=>(n.f[t](e,r),r),[])),n.u=e=>e+\\".\\"+e+\\".js\\",n.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),e={},r=\\"terser-webpack-plugin:\\",n.l=(t,o,a)=>{if(e[t])e[t].push(o);else{var i,l;if(void 0!==a)for(var u=document.getElementsByTagName(\\"script\\"),s=0;s{i.onerror=i.onload=null,clearTimeout(c);var n=e[t];if(delete e[t],i.parentNode&&i.parentNode.removeChild(i),n&&n.forEach(e=>e(o)),r)return r(o)},c=setTimeout(d.bind(null,void 0,{type:\\"timeout\\",target:i}),12e4);i.onerror=d.bind(null,i.onerror),i.onload=d.bind(null,i.onload),l&&document.head.appendChild(i)}},n.r=e=>{\\"undefined\\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:\\"Module\\"}),Object.defineProperty(e,\\"__esModule\\",{value:!0})},n.p=\\"\\",(()=>{var e={988:0};n.f.j=(r,t)=>{var o=n.o(e,r)?e[r]:void 0;if(0!==o)if(o)t.push(o[2]);else{var a=new Promise((t,n)=>{o=e[r]=[t,n]});t.push(o[2]=a);var i=n.p+n.u(r),l=new Error;n.l(i,t=>{if(n.o(e,r)&&(0!==(o=e[r])&&(e[r]=void 0),o)){var a=t&&(\\"load\\"===t.type?\\"missing\\":t.type),i=t&&t.target&&t.target.src;l.message=\\"Loading chunk \\"+r+\\" failed.\\\\n(\\"+a+\\": \\"+i+\\")\\",l.name=\\"ChunkLoadError\\",l.type=a,l.request=i,o[1](l)}},\\"chunk-\\"+r)}};var r=self.webpackChunkterser_webpack_plugin=self.webpackChunkterser_webpack_plugin||[],t=r.push.bind(r);r.push=r=>{for(var o,a,[i,l,u]=r,s=0,p=[];s{console.log(\\"Good\\")})})();", + "importExport.js": "(()=>{\\"use strict\\"})();", + "js.js": "(()=>{var r={791:r=>{r.exports=function(){console.log(7)}}},o={};!function t(e){if(o[e])return o[e].exports;var n=o[e]={exports:{}};return r[e](n,n.exports,t),n.exports}(791)})();", + "mjs.js": "(()=>{var r={631:r=>{r.exports=function(){console.log(7)}}},o={};!function t(e){if(o[e])return o[e].exports;var n=o[e]={exports:{}};return r[e](n,n.exports,t),n.exports}(631)})();", +} +`; + +exports[`TerserPlugin should work and use memory cache when the "cache" option is "true" and the asset has been changed: assets 2`] = ` +Object { + "598.598.js": "(self.webpackChunkterser_webpack_plugin=self.webpackChunkterser_webpack_plugin||[]).push([[598],{598:(e,s,p)=>{\\"use strict\\";p.r(s),p.d(s,{default:()=>c});const c=\\"async-dep\\"}}]);", + "AsyncImportExport.js": "(()=>{\\"use strict\\";var e,r,t={},o={};function n(e){if(o[e])return o[e].exports;var r=o[e]={exports:{}};return t[e](r,r.exports,n),r.exports}n.m=t,n.d=(e,r)=>{for(var t in r)n.o(r,t)&&!n.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:r[t]})},n.f={},n.e=e=>Promise.all(Object.keys(n.f).reduce((r,t)=>(n.f[t](e,r),r),[])),n.u=e=>e+\\".\\"+e+\\".js\\",n.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),e={},r=\\"terser-webpack-plugin:\\",n.l=(t,o,a)=>{if(e[t])e[t].push(o);else{var i,l;if(void 0!==a)for(var u=document.getElementsByTagName(\\"script\\"),s=0;s{i.onerror=i.onload=null,clearTimeout(c);var n=e[t];if(delete e[t],i.parentNode&&i.parentNode.removeChild(i),n&&n.forEach(e=>e(o)),r)return r(o)},c=setTimeout(d.bind(null,void 0,{type:\\"timeout\\",target:i}),12e4);i.onerror=d.bind(null,i.onerror),i.onload=d.bind(null,i.onload),l&&document.head.appendChild(i)}},n.r=e=>{\\"undefined\\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:\\"Module\\"}),Object.defineProperty(e,\\"__esModule\\",{value:!0})},n.p=\\"\\",(()=>{var e={988:0};n.f.j=(r,t)=>{var o=n.o(e,r)?e[r]:void 0;if(0!==o)if(o)t.push(o[2]);else{var a=new Promise((t,n)=>{o=e[r]=[t,n]});t.push(o[2]=a);var i=n.p+n.u(r),l=new Error;n.l(i,t=>{if(n.o(e,r)&&(0!==(o=e[r])&&(e[r]=void 0),o)){var a=t&&(\\"load\\"===t.type?\\"missing\\":t.type),i=t&&t.target&&t.target.src;l.message=\\"Loading chunk \\"+r+\\" failed.\\\\n(\\"+a+\\": \\"+i+\\")\\",l.name=\\"ChunkLoadError\\",l.type=a,l.request=i,o[1](l)}},\\"chunk-\\"+r)}};var r=self.webpackChunkterser_webpack_plugin=self.webpackChunkterser_webpack_plugin||[],t=r.push.bind(r);r.push=r=>{for(var o,a,[i,l,u]=r,s=0,p=[];s{console.log(\\"Good\\")})})();", + "importExport.js": "(()=>{\\"use strict\\"})();", + "js.js": "function changed(){}(()=>{var o={791:o=>{o.exports=function(){console.log(7)}}},r={};!function n(t){if(r[t])return r[t].exports;var e=r[t]={exports:{}};return o[t](e,e.exports,n),e.exports}(791)})();", + "mjs.js": "(()=>{var r={631:r=>{r.exports=function(){console.log(7)}}},o={};!function t(e){if(o[e])return o[e].exports;var n=o[e]={exports:{}};return r[e](n,n.exports,t),n.exports}(631)})();", +} +`; + +exports[`TerserPlugin should work and use memory cache when the "cache" option is "true" and the asset has been changed: errors 1`] = `Array []`; + +exports[`TerserPlugin should work and use memory cache when the "cache" option is "true" and the asset has been changed: errors 2`] = `Array []`; + +exports[`TerserPlugin should work and use memory cache when the "cache" option is "true" and the asset has been changed: warnings 1`] = `Array []`; + +exports[`TerserPlugin should work and use memory cache when the "cache" option is "true" and the asset has been changed: warnings 2`] = `Array []`; + +exports[`TerserPlugin should work and use memory cache when the "cache" option is "true": assets 1`] = ` +Object { + "598.598.js": "(self.webpackChunkterser_webpack_plugin=self.webpackChunkterser_webpack_plugin||[]).push([[598],{598:(e,s,p)=>{\\"use strict\\";p.r(s),p.d(s,{default:()=>c});const c=\\"async-dep\\"}}]);", + "AsyncImportExport.js": "(()=>{\\"use strict\\";var e,r,t={},o={};function n(e){if(o[e])return o[e].exports;var r=o[e]={exports:{}};return t[e](r,r.exports,n),r.exports}n.m=t,n.d=(e,r)=>{for(var t in r)n.o(r,t)&&!n.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:r[t]})},n.f={},n.e=e=>Promise.all(Object.keys(n.f).reduce((r,t)=>(n.f[t](e,r),r),[])),n.u=e=>e+\\".\\"+e+\\".js\\",n.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),e={},r=\\"terser-webpack-plugin:\\",n.l=(t,o,a)=>{if(e[t])e[t].push(o);else{var i,l;if(void 0!==a)for(var u=document.getElementsByTagName(\\"script\\"),s=0;s{i.onerror=i.onload=null,clearTimeout(c);var n=e[t];if(delete e[t],i.parentNode&&i.parentNode.removeChild(i),n&&n.forEach(e=>e(o)),r)return r(o)},c=setTimeout(d.bind(null,void 0,{type:\\"timeout\\",target:i}),12e4);i.onerror=d.bind(null,i.onerror),i.onload=d.bind(null,i.onload),l&&document.head.appendChild(i)}},n.r=e=>{\\"undefined\\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:\\"Module\\"}),Object.defineProperty(e,\\"__esModule\\",{value:!0})},n.p=\\"\\",(()=>{var e={988:0};n.f.j=(r,t)=>{var o=n.o(e,r)?e[r]:void 0;if(0!==o)if(o)t.push(o[2]);else{var a=new Promise((t,n)=>{o=e[r]=[t,n]});t.push(o[2]=a);var i=n.p+n.u(r),l=new Error;n.l(i,t=>{if(n.o(e,r)&&(0!==(o=e[r])&&(e[r]=void 0),o)){var a=t&&(\\"load\\"===t.type?\\"missing\\":t.type),i=t&&t.target&&t.target.src;l.message=\\"Loading chunk \\"+r+\\" failed.\\\\n(\\"+a+\\": \\"+i+\\")\\",l.name=\\"ChunkLoadError\\",l.type=a,l.request=i,o[1](l)}},\\"chunk-\\"+r)}};var r=self.webpackChunkterser_webpack_plugin=self.webpackChunkterser_webpack_plugin||[],t=r.push.bind(r);r.push=r=>{for(var o,a,[i,l,u]=r,s=0,p=[];s{console.log(\\"Good\\")})})();", + "importExport.js": "(()=>{\\"use strict\\"})();", + "js.js": "(()=>{var r={791:r=>{r.exports=function(){console.log(7)}}},o={};!function t(e){if(o[e])return o[e].exports;var n=o[e]={exports:{}};return r[e](n,n.exports,t),n.exports}(791)})();", + "mjs.js": "(()=>{var r={631:r=>{r.exports=function(){console.log(7)}}},o={};!function t(e){if(o[e])return o[e].exports;var n=o[e]={exports:{}};return r[e](n,n.exports,t),n.exports}(631)})();", +} +`; + +exports[`TerserPlugin should work and use memory cache when the "cache" option is "true": assets 2`] = ` +Object { + "598.598.js": "(self.webpackChunkterser_webpack_plugin=self.webpackChunkterser_webpack_plugin||[]).push([[598],{598:(e,s,p)=>{\\"use strict\\";p.r(s),p.d(s,{default:()=>c});const c=\\"async-dep\\"}}]);", + "AsyncImportExport.js": "(()=>{\\"use strict\\";var e,r,t={},o={};function n(e){if(o[e])return o[e].exports;var r=o[e]={exports:{}};return t[e](r,r.exports,n),r.exports}n.m=t,n.d=(e,r)=>{for(var t in r)n.o(r,t)&&!n.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:r[t]})},n.f={},n.e=e=>Promise.all(Object.keys(n.f).reduce((r,t)=>(n.f[t](e,r),r),[])),n.u=e=>e+\\".\\"+e+\\".js\\",n.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),e={},r=\\"terser-webpack-plugin:\\",n.l=(t,o,a)=>{if(e[t])e[t].push(o);else{var i,l;if(void 0!==a)for(var u=document.getElementsByTagName(\\"script\\"),s=0;s{i.onerror=i.onload=null,clearTimeout(c);var n=e[t];if(delete e[t],i.parentNode&&i.parentNode.removeChild(i),n&&n.forEach(e=>e(o)),r)return r(o)},c=setTimeout(d.bind(null,void 0,{type:\\"timeout\\",target:i}),12e4);i.onerror=d.bind(null,i.onerror),i.onload=d.bind(null,i.onload),l&&document.head.appendChild(i)}},n.r=e=>{\\"undefined\\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:\\"Module\\"}),Object.defineProperty(e,\\"__esModule\\",{value:!0})},n.p=\\"\\",(()=>{var e={988:0};n.f.j=(r,t)=>{var o=n.o(e,r)?e[r]:void 0;if(0!==o)if(o)t.push(o[2]);else{var a=new Promise((t,n)=>{o=e[r]=[t,n]});t.push(o[2]=a);var i=n.p+n.u(r),l=new Error;n.l(i,t=>{if(n.o(e,r)&&(0!==(o=e[r])&&(e[r]=void 0),o)){var a=t&&(\\"load\\"===t.type?\\"missing\\":t.type),i=t&&t.target&&t.target.src;l.message=\\"Loading chunk \\"+r+\\" failed.\\\\n(\\"+a+\\": \\"+i+\\")\\",l.name=\\"ChunkLoadError\\",l.type=a,l.request=i,o[1](l)}},\\"chunk-\\"+r)}};var r=self.webpackChunkterser_webpack_plugin=self.webpackChunkterser_webpack_plugin||[],t=r.push.bind(r);r.push=r=>{for(var o,a,[i,l,u]=r,s=0,p=[];s{console.log(\\"Good\\")})})();", + "importExport.js": "(()=>{\\"use strict\\"})();", + "js.js": "(()=>{var r={791:r=>{r.exports=function(){console.log(7)}}},o={};!function t(e){if(o[e])return o[e].exports;var n=o[e]={exports:{}};return r[e](n,n.exports,t),n.exports}(791)})();", + "mjs.js": "(()=>{var r={631:r=>{r.exports=function(){console.log(7)}}},o={};!function t(e){if(o[e])return o[e].exports;var n=o[e]={exports:{}};return r[e](n,n.exports,t),n.exports}(631)})();", +} +`; + +exports[`TerserPlugin should work and use memory cache when the "cache" option is "true": errors 1`] = `Array []`; + +exports[`TerserPlugin should work and use memory cache when the "cache" option is "true": errors 2`] = `Array []`; + +exports[`TerserPlugin should work and use memory cache when the "cache" option is "true": warnings 1`] = `Array []`; + +exports[`TerserPlugin should work and use memory cache when the "cache" option is "true": warnings 2`] = `Array []`; + exports[`TerserPlugin should work as a minimizer: assets 1`] = ` Object { "main.js": "(()=>{var r={791:r=>{r.exports=function(){console.log(7)}}},o={};!function t(e){if(o[e])return o[e].exports;var n=o[e]={exports:{}};return r[e](n,n.exports,t),n.exports}(791)})();", @@ -520,6 +604,578 @@ exports[`TerserPlugin should work with child compilation: errors 1`] = `Array [] exports[`TerserPlugin should work with child compilation: warnings 1`] = `Array []`; +exports[`TerserPlugin should work with source map and use memory cache when the "cache" option is "true" and the asset has been changed: assets 1`] = ` +Object { + "598.598.js": "(self.webpackChunkterser_webpack_plugin=self.webpackChunkterser_webpack_plugin||[]).push([[598],{598:(e,s,p)=>{\\"use strict\\";p.r(s),p.d(s,{default:()=>c});const c=\\"async-dep\\"}}]); +//# sourceMappingURL=598.598.js.map", + "598.598.js.map": "{\\"version\\":3,\\"sources\\":[\\"webpack://terser-webpack-plugin/./test/fixtures/async-import-export/async-dep.js\\"],\\"names\\":[],\\"mappings\\":\\"0JAAA\\",\\"file\\":\\"598.598.js\\",\\"sourcesContent\\":[\\"export default \\\\\\"async-dep\\\\\\";\\\\n\\"],\\"sourceRoot\\":\\"\\"}", + "AsyncImportExport.js": "(()=>{\\"use strict\\";var e,r,t={},o={};function n(e){if(o[e])return o[e].exports;var r=o[e]={exports:{}};return t[e](r,r.exports,n),r.exports}n.m=t,n.d=(e,r)=>{for(var t in r)n.o(r,t)&&!n.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:r[t]})},n.f={},n.e=e=>Promise.all(Object.keys(n.f).reduce((r,t)=>(n.f[t](e,r),r),[])),n.u=e=>e+\\".\\"+e+\\".js\\",n.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),e={},r=\\"terser-webpack-plugin:\\",n.l=(t,o,a)=>{if(e[t])e[t].push(o);else{var i,l;if(void 0!==a)for(var u=document.getElementsByTagName(\\"script\\"),s=0;s{i.onerror=i.onload=null,clearTimeout(c);var n=e[t];if(delete e[t],i.parentNode&&i.parentNode.removeChild(i),n&&n.forEach(e=>e(o)),r)return r(o)},c=setTimeout(d.bind(null,void 0,{type:\\"timeout\\",target:i}),12e4);i.onerror=d.bind(null,i.onerror),i.onload=d.bind(null,i.onload),l&&document.head.appendChild(i)}},n.r=e=>{\\"undefined\\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:\\"Module\\"}),Object.defineProperty(e,\\"__esModule\\",{value:!0})},n.p=\\"\\",(()=>{var e={988:0};n.f.j=(r,t)=>{var o=n.o(e,r)?e[r]:void 0;if(0!==o)if(o)t.push(o[2]);else{var a=new Promise((t,n)=>{o=e[r]=[t,n]});t.push(o[2]=a);var i=n.p+n.u(r),l=new Error;n.l(i,t=>{if(n.o(e,r)&&(0!==(o=e[r])&&(e[r]=void 0),o)){var a=t&&(\\"load\\"===t.type?\\"missing\\":t.type),i=t&&t.target&&t.target.src;l.message=\\"Loading chunk \\"+r+\\" failed.\\\\n(\\"+a+\\": \\"+i+\\")\\",l.name=\\"ChunkLoadError\\",l.type=a,l.request=i,o[1](l)}},\\"chunk-\\"+r)}};var r=self.webpackChunkterser_webpack_plugin=self.webpackChunkterser_webpack_plugin||[],t=r.push.bind(r);r.push=r=>{for(var o,a,[i,l,u]=r,s=0,p=[];s{console.log(\\"Good\\")})})(); +//# sourceMappingURL=AsyncImportExport.js.map", + "AsyncImportExport.js.map": "{\\"version\\":3,\\"sources\\":[\\"webpack://terser-webpack-plugin/webpack/runtime/load script\\",\\"webpack://terser-webpack-plugin/webpack/bootstrap\\",\\"webpack://terser-webpack-plugin/webpack/runtime/define property getters\\",\\"webpack://terser-webpack-plugin/webpack/runtime/ensure chunk\\",\\"webpack://terser-webpack-plugin/webpack/runtime/get javascript chunk filename\\",\\"webpack://terser-webpack-plugin/webpack/runtime/hasOwnProperty shorthand\\",\\"webpack://terser-webpack-plugin/webpack/runtime/make namespace object\\",\\"webpack://terser-webpack-plugin/webpack/runtime/publicPath\\",\\"webpack://terser-webpack-plugin/webpack/runtime/jsonp chunk loading\\",\\"webpack://terser-webpack-plugin/./test/fixtures/async-import-export/entry.js\\"],\\"names\\":[\\"inProgress\\",\\"dataWebpackPrefix\\",\\"__webpack_module_cache__\\",\\"__webpack_require__\\",\\"moduleId\\",\\"exports\\",\\"module\\",\\"__webpack_modules__\\",\\"m\\",\\"d\\",\\"definition\\",\\"key\\",\\"o\\",\\"Object\\",\\"defineProperty\\",\\"enumerable\\",\\"get\\",\\"f\\",\\"e\\",\\"chunkId\\",\\"Promise\\",\\"all\\",\\"keys\\",\\"reduce\\",\\"promises\\",\\"u\\",\\"obj\\",\\"prop\\",\\"prototype\\",\\"hasOwnProperty\\",\\"call\\",\\"l\\",\\"url\\",\\"done\\",\\"push\\",\\"script\\",\\"needAttach\\",\\"undefined\\",\\"scripts\\",\\"document\\",\\"getElementsByTagName\\",\\"i\\",\\"length\\",\\"s\\",\\"getAttribute\\",\\"createElement\\",\\"charset\\",\\"timeout\\",\\"nc\\",\\"setAttribute\\",\\"src\\",\\"onScriptComplete\\",\\"prev\\",\\"event\\",\\"onerror\\",\\"onload\\",\\"clearTimeout\\",\\"doneFns\\",\\"parentNode\\",\\"removeChild\\",\\"forEach\\",\\"fn\\",\\"setTimeout\\",\\"bind\\",\\"type\\",\\"target\\",\\"head\\",\\"appendChild\\",\\"r\\",\\"Symbol\\",\\"toStringTag\\",\\"value\\",\\"p\\",\\"installedChunks\\",\\"988\\",\\"j\\",\\"installedChunkData\\",\\"promise\\",\\"resolve\\",\\"reject\\",\\"error\\",\\"Error\\",\\"errorType\\",\\"realSrc\\",\\"message\\",\\"name\\",\\"request\\",\\"chunkLoadingGlobal\\",\\"self\\",\\"parentChunkLoadingFunction\\",\\"data\\",\\"chunkIds\\",\\"moreModules\\",\\"runtime\\",\\"resolves\\",\\"shift\\",\\"then\\",\\"console\\",\\"log\\"],\\"mappings\\":\\"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\\",\\"file\\":\\"AsyncImportExport.js\\",\\"sourcesContent\\":[\\"var inProgress = {};\\\\nvar dataWebpackPrefix = \\\\\\"terser-webpack-plugin:\\\\\\";\\\\n// loadScript function to load a script via script tag\\\\n__webpack_require__.l = (url, done, key) => {\\\\n\\\\tif(inProgress[url]) { inProgress[url].push(done); return; }\\\\n\\\\tvar script, needAttach;\\\\n\\\\tif(key !== undefined) {\\\\n\\\\t\\\\tvar scripts = document.getElementsByTagName(\\\\\\"script\\\\\\");\\\\n\\\\t\\\\tfor(var i = 0; i < scripts.length; i++) {\\\\n\\\\t\\\\t\\\\tvar s = scripts[i];\\\\n\\\\t\\\\t\\\\tif(s.getAttribute(\\\\\\"src\\\\\\") == url || s.getAttribute(\\\\\\"data-webpack\\\\\\") == dataWebpackPrefix + key) { script = s; break; }\\\\n\\\\t\\\\t}\\\\n\\\\t}\\\\n\\\\tif(!script) {\\\\n\\\\t\\\\tneedAttach = true;\\\\n\\\\t\\\\tscript = document.createElement('script');\\\\n\\\\n\\\\t\\\\tscript.charset = 'utf-8';\\\\n\\\\t\\\\tscript.timeout = 120;\\\\n\\\\t\\\\tif (__webpack_require__.nc) {\\\\n\\\\t\\\\t\\\\tscript.setAttribute(\\\\\\"nonce\\\\\\", __webpack_require__.nc);\\\\n\\\\t\\\\t}\\\\n\\\\t\\\\tscript.setAttribute(\\\\\\"data-webpack\\\\\\", dataWebpackPrefix + key);\\\\n\\\\t\\\\tscript.src = url;\\\\n\\\\t}\\\\n\\\\tinProgress[url] = [done];\\\\n\\\\tvar onScriptComplete = (prev, event) => {\\\\n\\\\t\\\\t// avoid mem leaks in IE.\\\\n\\\\t\\\\tscript.onerror = script.onload = null;\\\\n\\\\t\\\\tclearTimeout(timeout);\\\\n\\\\t\\\\tvar doneFns = inProgress[url];\\\\n\\\\t\\\\tdelete inProgress[url];\\\\n\\\\t\\\\tscript.parentNode && script.parentNode.removeChild(script);\\\\n\\\\t\\\\tdoneFns && doneFns.forEach((fn) => fn(event));\\\\n\\\\t\\\\tif(prev) return prev(event);\\\\n\\\\t}\\\\n\\\\t;\\\\n\\\\tvar timeout = setTimeout(onScriptComplete.bind(null, undefined, { type: 'timeout', target: script }), 120000);\\\\n\\\\tscript.onerror = onScriptComplete.bind(null, script.onerror);\\\\n\\\\tscript.onload = onScriptComplete.bind(null, script.onload);\\\\n\\\\tneedAttach && document.head.appendChild(script);\\\\n};\\",\\"// The module cache\\\\nvar __webpack_module_cache__ = {};\\\\n\\\\n// The require function\\\\nfunction __webpack_require__(moduleId) {\\\\n\\\\t// Check if module is in cache\\\\n\\\\tif(__webpack_module_cache__[moduleId]) {\\\\n\\\\t\\\\treturn __webpack_module_cache__[moduleId].exports;\\\\n\\\\t}\\\\n\\\\t// Create a new module (and put it into the cache)\\\\n\\\\tvar module = __webpack_module_cache__[moduleId] = {\\\\n\\\\t\\\\t// no module.id needed\\\\n\\\\t\\\\t// no module.loaded needed\\\\n\\\\t\\\\texports: {}\\\\n\\\\t};\\\\n\\\\n\\\\t// Execute the module function\\\\n\\\\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\\\\n\\\\n\\\\t// Return the exports of the module\\\\n\\\\treturn module.exports;\\\\n}\\\\n\\\\n// expose the modules object (__webpack_modules__)\\\\n__webpack_require__.m = __webpack_modules__;\\\\n\\\\n\\",\\"// define getter functions for harmony exports\\\\n__webpack_require__.d = (exports, definition) => {\\\\n\\\\tfor(var key in definition) {\\\\n\\\\t\\\\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\\\\n\\\\t\\\\t\\\\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\\\\n\\\\t\\\\t}\\\\n\\\\t}\\\\n};\\",\\"__webpack_require__.f = {};\\\\n// This file contains only the entry chunk.\\\\n// The chunk loading function for additional chunks\\\\n__webpack_require__.e = (chunkId) => {\\\\n\\\\treturn Promise.all(Object.keys(__webpack_require__.f).reduce((promises, key) => {\\\\n\\\\t\\\\t__webpack_require__.f[key](chunkId, promises);\\\\n\\\\t\\\\treturn promises;\\\\n\\\\t}, []));\\\\n};\\",\\"// This function allow to reference async chunks\\\\n__webpack_require__.u = (chunkId) => {\\\\n\\\\t// return url for filenames based on template\\\\n\\\\treturn \\\\\\"\\\\\\" + chunkId + \\\\\\".\\\\\\" + chunkId + \\\\\\".js\\\\\\";\\\\n};\\",\\"__webpack_require__.o = (obj, prop) => Object.prototype.hasOwnProperty.call(obj, prop)\\",\\"// define __esModule on exports\\\\n__webpack_require__.r = (exports) => {\\\\n\\\\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\\\\n\\\\t\\\\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\\\\n\\\\t}\\\\n\\\\tObject.defineProperty(exports, '__esModule', { value: true });\\\\n};\\",\\"__webpack_require__.p = \\\\\\"\\\\\\";\\",\\"// object to store loaded and loading chunks\\\\n// undefined = chunk not loaded, null = chunk preloaded/prefetched\\\\n// Promise = chunk loading, 0 = chunk loaded\\\\nvar installedChunks = {\\\\n\\\\t988: 0\\\\n};\\\\n\\\\n\\\\n__webpack_require__.f.j = (chunkId, promises) => {\\\\n\\\\t\\\\t// JSONP chunk loading for javascript\\\\n\\\\t\\\\tvar installedChunkData = __webpack_require__.o(installedChunks, chunkId) ? installedChunks[chunkId] : undefined;\\\\n\\\\t\\\\tif(installedChunkData !== 0) { // 0 means \\\\\\"already installed\\\\\\".\\\\n\\\\n\\\\t\\\\t\\\\t// a Promise means \\\\\\"currently loading\\\\\\".\\\\n\\\\t\\\\t\\\\tif(installedChunkData) {\\\\n\\\\t\\\\t\\\\t\\\\tpromises.push(installedChunkData[2]);\\\\n\\\\t\\\\t\\\\t} else {\\\\n\\\\t\\\\t\\\\t\\\\tif(true) { // all chunks have JS\\\\n\\\\t\\\\t\\\\t\\\\t\\\\t// setup Promise in chunk cache\\\\n\\\\t\\\\t\\\\t\\\\t\\\\tvar promise = new Promise((resolve, reject) => {\\\\n\\\\t\\\\t\\\\t\\\\t\\\\t\\\\tinstalledChunkData = installedChunks[chunkId] = [resolve, reject];\\\\n\\\\t\\\\t\\\\t\\\\t\\\\t});\\\\n\\\\t\\\\t\\\\t\\\\t\\\\tpromises.push(installedChunkData[2] = promise);\\\\n\\\\n\\\\t\\\\t\\\\t\\\\t\\\\t// start chunk loading\\\\n\\\\t\\\\t\\\\t\\\\t\\\\tvar url = __webpack_require__.p + __webpack_require__.u(chunkId);\\\\n\\\\t\\\\t\\\\t\\\\t\\\\t// create error before stack unwound to get useful stacktrace later\\\\n\\\\t\\\\t\\\\t\\\\t\\\\tvar error = new Error();\\\\n\\\\t\\\\t\\\\t\\\\t\\\\tvar loadingEnded = (event) => {\\\\n\\\\t\\\\t\\\\t\\\\t\\\\t\\\\tif(__webpack_require__.o(installedChunks, chunkId)) {\\\\n\\\\t\\\\t\\\\t\\\\t\\\\t\\\\t\\\\tinstalledChunkData = installedChunks[chunkId];\\\\n\\\\t\\\\t\\\\t\\\\t\\\\t\\\\t\\\\tif(installedChunkData !== 0) installedChunks[chunkId] = undefined;\\\\n\\\\t\\\\t\\\\t\\\\t\\\\t\\\\t\\\\tif(installedChunkData) {\\\\n\\\\t\\\\t\\\\t\\\\t\\\\t\\\\t\\\\t\\\\tvar errorType = event && (event.type === 'load' ? 'missing' : event.type);\\\\n\\\\t\\\\t\\\\t\\\\t\\\\t\\\\t\\\\t\\\\tvar realSrc = event && event.target && event.target.src;\\\\n\\\\t\\\\t\\\\t\\\\t\\\\t\\\\t\\\\t\\\\terror.message = 'Loading chunk ' + chunkId + ' failed.\\\\\\\\n(' + errorType + ': ' + realSrc + ')';\\\\n\\\\t\\\\t\\\\t\\\\t\\\\t\\\\t\\\\t\\\\terror.name = 'ChunkLoadError';\\\\n\\\\t\\\\t\\\\t\\\\t\\\\t\\\\t\\\\t\\\\terror.type = errorType;\\\\n\\\\t\\\\t\\\\t\\\\t\\\\t\\\\t\\\\t\\\\terror.request = realSrc;\\\\n\\\\t\\\\t\\\\t\\\\t\\\\t\\\\t\\\\t\\\\tinstalledChunkData[1](error);\\\\n\\\\t\\\\t\\\\t\\\\t\\\\t\\\\t\\\\t}\\\\n\\\\t\\\\t\\\\t\\\\t\\\\t\\\\t}\\\\n\\\\t\\\\t\\\\t\\\\t\\\\t};\\\\n\\\\t\\\\t\\\\t\\\\t\\\\t__webpack_require__.l(url, loadingEnded, \\\\\\"chunk-\\\\\\" + chunkId);\\\\n\\\\t\\\\t\\\\t\\\\t} else installedChunks[chunkId] = 0;\\\\n\\\\t\\\\t\\\\t}\\\\n\\\\t\\\\t}\\\\n};\\\\n\\\\n// no prefetching\\\\n\\\\n// no preloaded\\\\n\\\\n// no HMR\\\\n\\\\n// no HMR manifest\\\\n\\\\n// no deferred startup\\\\n\\\\n// install a JSONP callback for chunk loading\\\\nvar webpackJsonpCallback = (data) => {\\\\n\\\\tvar [chunkIds, moreModules, runtime] = data;\\\\n\\\\t// add \\\\\\"moreModules\\\\\\" to the modules object,\\\\n\\\\t// then flag all \\\\\\"chunkIds\\\\\\" as loaded and fire callback\\\\n\\\\tvar moduleId, chunkId, i = 0, resolves = [];\\\\n\\\\tfor(;i < chunkIds.length; i++) {\\\\n\\\\t\\\\tchunkId = chunkIds[i];\\\\n\\\\t\\\\tif(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) {\\\\n\\\\t\\\\t\\\\tresolves.push(installedChunks[chunkId][0]);\\\\n\\\\t\\\\t}\\\\n\\\\t\\\\tinstalledChunks[chunkId] = 0;\\\\n\\\\t}\\\\n\\\\tfor(moduleId in moreModules) {\\\\n\\\\t\\\\tif(__webpack_require__.o(moreModules, moduleId)) {\\\\n\\\\t\\\\t\\\\t__webpack_require__.m[moduleId] = moreModules[moduleId];\\\\n\\\\t\\\\t}\\\\n\\\\t}\\\\n\\\\tif(runtime) runtime(__webpack_require__);\\\\n\\\\tparentChunkLoadingFunction(data);\\\\n\\\\twhile(resolves.length) {\\\\n\\\\t\\\\tresolves.shift()();\\\\n\\\\t}\\\\n\\\\n}\\\\n\\\\nvar chunkLoadingGlobal = self[\\\\\\"webpackChunkterser_webpack_plugin\\\\\\"] = self[\\\\\\"webpackChunkterser_webpack_plugin\\\\\\"] || [];\\\\nvar parentChunkLoadingFunction = chunkLoadingGlobal.push.bind(chunkLoadingGlobal);\\\\nchunkLoadingGlobal.push = webpackJsonpCallback;\\",\\"import(\\\\\\"./async-dep\\\\\\").then(() => {\\\\n console.log('Good')\\\\n});\\\\n\\\\nexport default \\\\\\"Awesome\\\\\\";\\\\n\\"],\\"sourceRoot\\":\\"\\"}", + "importExport.js": "(()=>{\\"use strict\\"})(); +//# sourceMappingURL=importExport.js.map", + "importExport.js.map": "{\\"version\\":3,\\"sources\\":[],\\"names\\":[],\\"mappings\\":\\"\\",\\"file\\":\\"importExport.js\\",\\"sourceRoot\\":\\"\\"}", + "js.js": "(()=>{var r={791:r=>{r.exports=function(){console.log(7)}}},o={};!function t(e){if(o[e])return o[e].exports;var n=o[e]={exports:{}};return r[e](n,n.exports,t),n.exports}(791)})(); +//# sourceMappingURL=js.js.map", + "js.js.map": "{\\"version\\":3,\\"sources\\":[\\"webpack://terser-webpack-plugin/./test/fixtures/entry.js\\",\\"webpack://terser-webpack-plugin/webpack/bootstrap\\",\\"webpack://terser-webpack-plugin/webpack/startup\\"],\\"names\\":[\\"module\\",\\"exports\\",\\"console\\",\\"log\\",\\"b\\",\\"__webpack_module_cache__\\",\\"__webpack_require__\\",\\"moduleId\\",\\"__webpack_modules__\\"],\\"mappings\\":\\"qBAKAA,EAAOC,QAAU,WAEfC,QAAQC,IAAIC,MCNVC,EAA2B,IAG/B,SAASC,EAAoBC,GAE5B,GAAGF,EAAyBE,GAC3B,OAAOF,EAAyBE,GAAUN,QAG3C,IAAID,EAASK,EAAyBE,GAAY,CAGjDN,QAAS,IAOV,OAHAO,EAAoBD,GAAUP,EAAQA,EAAOC,QAASK,GAG/CN,EAAOC,QCjBfK,CAAoB,M\\",\\"file\\":\\"js.js\\",\\"sourcesContent\\":[\\"// foo\\\\n/* @preserve*/\\\\n// bar\\\\nconst a = 2 + 2;\\\\n\\\\nmodule.exports = function Foo() {\\\\n const b = 2 + 2;\\\\n console.log(b + 1 + 2);\\\\n};\\\\n\\",\\"// The module cache\\\\nvar __webpack_module_cache__ = {};\\\\n\\\\n// The require function\\\\nfunction __webpack_require__(moduleId) {\\\\n\\\\t// Check if module is in cache\\\\n\\\\tif(__webpack_module_cache__[moduleId]) {\\\\n\\\\t\\\\treturn __webpack_module_cache__[moduleId].exports;\\\\n\\\\t}\\\\n\\\\t// Create a new module (and put it into the cache)\\\\n\\\\tvar module = __webpack_module_cache__[moduleId] = {\\\\n\\\\t\\\\t// no module.id needed\\\\n\\\\t\\\\t// no module.loaded needed\\\\n\\\\t\\\\texports: {}\\\\n\\\\t};\\\\n\\\\n\\\\t// Execute the module function\\\\n\\\\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\\\\n\\\\n\\\\t// Return the exports of the module\\\\n\\\\treturn module.exports;\\\\n}\\\\n\\\\n\\",\\"// startup\\\\n// Load entry module\\\\n// This entry module is referenced by other modules so it can't be inlined\\\\n__webpack_require__(791);\\\\n\\"],\\"sourceRoot\\":\\"\\"}", + "mjs.js": "(()=>{var r={631:r=>{r.exports=function(){console.log(7)}}},o={};!function t(e){if(o[e])return o[e].exports;var n=o[e]={exports:{}};return r[e](n,n.exports,t),n.exports}(631)})(); +//# sourceMappingURL=mjs.js.map", + "mjs.js.map": "{\\"version\\":3,\\"sources\\":[\\"webpack://terser-webpack-plugin/./test/fixtures/entry.mjs\\",\\"webpack://terser-webpack-plugin/webpack/bootstrap\\",\\"webpack://terser-webpack-plugin/webpack/startup\\"],\\"names\\":[\\"module\\",\\"exports\\",\\"console\\",\\"log\\",\\"b\\",\\"__webpack_module_cache__\\",\\"__webpack_require__\\",\\"moduleId\\",\\"__webpack_modules__\\"],\\"mappings\\":\\"qBAKAA,EAAOC,QAAU,WAEfC,QAAQC,IAAIC,MCNVC,EAA2B,IAG/B,SAASC,EAAoBC,GAE5B,GAAGF,EAAyBE,GAC3B,OAAOF,EAAyBE,GAAUN,QAG3C,IAAID,EAASK,EAAyBE,GAAY,CAGjDN,QAAS,IAOV,OAHAO,EAAoBD,GAAUP,EAAQA,EAAOC,QAASK,GAG/CN,EAAOC,QCjBfK,CAAoB,M\\",\\"file\\":\\"mjs.js\\",\\"sourcesContent\\":[\\"// foo\\\\n/* @preserve*/\\\\n// bar\\\\nconst a = 2 + 2;\\\\n\\\\nmodule.exports = function Foo() {\\\\n const b = 2 + 2;\\\\n console.log(b + 1 + 2);\\\\n};\\\\n\\",\\"// The module cache\\\\nvar __webpack_module_cache__ = {};\\\\n\\\\n// The require function\\\\nfunction __webpack_require__(moduleId) {\\\\n\\\\t// Check if module is in cache\\\\n\\\\tif(__webpack_module_cache__[moduleId]) {\\\\n\\\\t\\\\treturn __webpack_module_cache__[moduleId].exports;\\\\n\\\\t}\\\\n\\\\t// Create a new module (and put it into the cache)\\\\n\\\\tvar module = __webpack_module_cache__[moduleId] = {\\\\n\\\\t\\\\t// no module.id needed\\\\n\\\\t\\\\t// no module.loaded needed\\\\n\\\\t\\\\texports: {}\\\\n\\\\t};\\\\n\\\\n\\\\t// Execute the module function\\\\n\\\\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\\\\n\\\\n\\\\t// Return the exports of the module\\\\n\\\\treturn module.exports;\\\\n}\\\\n\\\\n\\",\\"// startup\\\\n// Load entry module\\\\n// This entry module is referenced by other modules so it can't be inlined\\\\n__webpack_require__(631);\\\\n\\"],\\"sourceRoot\\":\\"\\"}", +} +`; + +exports[`TerserPlugin should work with source map and use memory cache when the "cache" option is "true" and the asset has been changed: assets 2`] = ` +Object { + "598.598.js": "(self.webpackChunkterser_webpack_plugin=self.webpackChunkterser_webpack_plugin||[]).push([[598],{598:(e,s,p)=>{\\"use strict\\";p.r(s),p.d(s,{default:()=>c});const c=\\"async-dep\\"}}]); +//# sourceMappingURL=598.598.js.map", + "598.598.js.map": "{\\"version\\":3,\\"sources\\":[\\"webpack://terser-webpack-plugin/./test/fixtures/async-import-export/async-dep.js\\"],\\"names\\":[],\\"mappings\\":\\"0JAAA\\",\\"file\\":\\"598.598.js\\",\\"sourcesContent\\":[\\"export default \\\\\\"async-dep\\\\\\";\\\\n\\"],\\"sourceRoot\\":\\"\\"}", + "AsyncImportExport.js": "(()=>{\\"use strict\\";var e,r,t={},o={};function n(e){if(o[e])return o[e].exports;var r=o[e]={exports:{}};return t[e](r,r.exports,n),r.exports}n.m=t,n.d=(e,r)=>{for(var t in r)n.o(r,t)&&!n.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:r[t]})},n.f={},n.e=e=>Promise.all(Object.keys(n.f).reduce((r,t)=>(n.f[t](e,r),r),[])),n.u=e=>e+\\".\\"+e+\\".js\\",n.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),e={},r=\\"terser-webpack-plugin:\\",n.l=(t,o,a)=>{if(e[t])e[t].push(o);else{var i,l;if(void 0!==a)for(var u=document.getElementsByTagName(\\"script\\"),s=0;s{i.onerror=i.onload=null,clearTimeout(c);var n=e[t];if(delete e[t],i.parentNode&&i.parentNode.removeChild(i),n&&n.forEach(e=>e(o)),r)return r(o)},c=setTimeout(d.bind(null,void 0,{type:\\"timeout\\",target:i}),12e4);i.onerror=d.bind(null,i.onerror),i.onload=d.bind(null,i.onload),l&&document.head.appendChild(i)}},n.r=e=>{\\"undefined\\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:\\"Module\\"}),Object.defineProperty(e,\\"__esModule\\",{value:!0})},n.p=\\"\\",(()=>{var e={988:0};n.f.j=(r,t)=>{var o=n.o(e,r)?e[r]:void 0;if(0!==o)if(o)t.push(o[2]);else{var a=new Promise((t,n)=>{o=e[r]=[t,n]});t.push(o[2]=a);var i=n.p+n.u(r),l=new Error;n.l(i,t=>{if(n.o(e,r)&&(0!==(o=e[r])&&(e[r]=void 0),o)){var a=t&&(\\"load\\"===t.type?\\"missing\\":t.type),i=t&&t.target&&t.target.src;l.message=\\"Loading chunk \\"+r+\\" failed.\\\\n(\\"+a+\\": \\"+i+\\")\\",l.name=\\"ChunkLoadError\\",l.type=a,l.request=i,o[1](l)}},\\"chunk-\\"+r)}};var r=self.webpackChunkterser_webpack_plugin=self.webpackChunkterser_webpack_plugin||[],t=r.push.bind(r);r.push=r=>{for(var o,a,[i,l,u]=r,s=0,p=[];s{console.log(\\"Good\\")})})(); +//# sourceMappingURL=AsyncImportExport.js.map", + "AsyncImportExport.js.map": "{\\"version\\":3,\\"sources\\":[\\"webpack://terser-webpack-plugin/webpack/runtime/load script\\",\\"webpack://terser-webpack-plugin/webpack/bootstrap\\",\\"webpack://terser-webpack-plugin/webpack/runtime/define property getters\\",\\"webpack://terser-webpack-plugin/webpack/runtime/ensure chunk\\",\\"webpack://terser-webpack-plugin/webpack/runtime/get javascript chunk filename\\",\\"webpack://terser-webpack-plugin/webpack/runtime/hasOwnProperty shorthand\\",\\"webpack://terser-webpack-plugin/webpack/runtime/make namespace object\\",\\"webpack://terser-webpack-plugin/webpack/runtime/publicPath\\",\\"webpack://terser-webpack-plugin/webpack/runtime/jsonp chunk loading\\",\\"webpack://terser-webpack-plugin/./test/fixtures/async-import-export/entry.js\\"],\\"names\\":[\\"inProgress\\",\\"dataWebpackPrefix\\",\\"__webpack_module_cache__\\",\\"__webpack_require__\\",\\"moduleId\\",\\"exports\\",\\"module\\",\\"__webpack_modules__\\",\\"m\\",\\"d\\",\\"definition\\",\\"key\\",\\"o\\",\\"Object\\",\\"defineProperty\\",\\"enumerable\\",\\"get\\",\\"f\\",\\"e\\",\\"chunkId\\",\\"Promise\\",\\"all\\",\\"keys\\",\\"reduce\\",\\"promises\\",\\"u\\",\\"obj\\",\\"prop\\",\\"prototype\\",\\"hasOwnProperty\\",\\"call\\",\\"l\\",\\"url\\",\\"done\\",\\"push\\",\\"script\\",\\"needAttach\\",\\"undefined\\",\\"scripts\\",\\"document\\",\\"getElementsByTagName\\",\\"i\\",\\"length\\",\\"s\\",\\"getAttribute\\",\\"createElement\\",\\"charset\\",\\"timeout\\",\\"nc\\",\\"setAttribute\\",\\"src\\",\\"onScriptComplete\\",\\"prev\\",\\"event\\",\\"onerror\\",\\"onload\\",\\"clearTimeout\\",\\"doneFns\\",\\"parentNode\\",\\"removeChild\\",\\"forEach\\",\\"fn\\",\\"setTimeout\\",\\"bind\\",\\"type\\",\\"target\\",\\"head\\",\\"appendChild\\",\\"r\\",\\"Symbol\\",\\"toStringTag\\",\\"value\\",\\"p\\",\\"installedChunks\\",\\"988\\",\\"j\\",\\"installedChunkData\\",\\"promise\\",\\"resolve\\",\\"reject\\",\\"error\\",\\"Error\\",\\"errorType\\",\\"realSrc\\",\\"message\\",\\"name\\",\\"request\\",\\"chunkLoadingGlobal\\",\\"self\\",\\"parentChunkLoadingFunction\\",\\"data\\",\\"chunkIds\\",\\"moreModules\\",\\"runtime\\",\\"resolves\\",\\"shift\\",\\"then\\",\\"console\\",\\"log\\"],\\"mappings\\":\\"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\\",\\"file\\":\\"AsyncImportExport.js\\",\\"sourcesContent\\":[\\"var inProgress = {};\\\\nvar dataWebpackPrefix = \\\\\\"terser-webpack-plugin:\\\\\\";\\\\n// loadScript function to load a script via script tag\\\\n__webpack_require__.l = (url, done, key) => {\\\\n\\\\tif(inProgress[url]) { inProgress[url].push(done); return; }\\\\n\\\\tvar script, needAttach;\\\\n\\\\tif(key !== undefined) {\\\\n\\\\t\\\\tvar scripts = document.getElementsByTagName(\\\\\\"script\\\\\\");\\\\n\\\\t\\\\tfor(var i = 0; i < scripts.length; i++) {\\\\n\\\\t\\\\t\\\\tvar s = scripts[i];\\\\n\\\\t\\\\t\\\\tif(s.getAttribute(\\\\\\"src\\\\\\") == url || s.getAttribute(\\\\\\"data-webpack\\\\\\") == dataWebpackPrefix + key) { script = s; break; }\\\\n\\\\t\\\\t}\\\\n\\\\t}\\\\n\\\\tif(!script) {\\\\n\\\\t\\\\tneedAttach = true;\\\\n\\\\t\\\\tscript = document.createElement('script');\\\\n\\\\n\\\\t\\\\tscript.charset = 'utf-8';\\\\n\\\\t\\\\tscript.timeout = 120;\\\\n\\\\t\\\\tif (__webpack_require__.nc) {\\\\n\\\\t\\\\t\\\\tscript.setAttribute(\\\\\\"nonce\\\\\\", __webpack_require__.nc);\\\\n\\\\t\\\\t}\\\\n\\\\t\\\\tscript.setAttribute(\\\\\\"data-webpack\\\\\\", dataWebpackPrefix + key);\\\\n\\\\t\\\\tscript.src = url;\\\\n\\\\t}\\\\n\\\\tinProgress[url] = [done];\\\\n\\\\tvar onScriptComplete = (prev, event) => {\\\\n\\\\t\\\\t// avoid mem leaks in IE.\\\\n\\\\t\\\\tscript.onerror = script.onload = null;\\\\n\\\\t\\\\tclearTimeout(timeout);\\\\n\\\\t\\\\tvar doneFns = inProgress[url];\\\\n\\\\t\\\\tdelete inProgress[url];\\\\n\\\\t\\\\tscript.parentNode && script.parentNode.removeChild(script);\\\\n\\\\t\\\\tdoneFns && doneFns.forEach((fn) => fn(event));\\\\n\\\\t\\\\tif(prev) return prev(event);\\\\n\\\\t}\\\\n\\\\t;\\\\n\\\\tvar timeout = setTimeout(onScriptComplete.bind(null, undefined, { type: 'timeout', target: script }), 120000);\\\\n\\\\tscript.onerror = onScriptComplete.bind(null, script.onerror);\\\\n\\\\tscript.onload = onScriptComplete.bind(null, script.onload);\\\\n\\\\tneedAttach && document.head.appendChild(script);\\\\n};\\",\\"// The module cache\\\\nvar __webpack_module_cache__ = {};\\\\n\\\\n// The require function\\\\nfunction __webpack_require__(moduleId) {\\\\n\\\\t// Check if module is in cache\\\\n\\\\tif(__webpack_module_cache__[moduleId]) {\\\\n\\\\t\\\\treturn __webpack_module_cache__[moduleId].exports;\\\\n\\\\t}\\\\n\\\\t// Create a new module (and put it into the cache)\\\\n\\\\tvar module = __webpack_module_cache__[moduleId] = {\\\\n\\\\t\\\\t// no module.id needed\\\\n\\\\t\\\\t// no module.loaded needed\\\\n\\\\t\\\\texports: {}\\\\n\\\\t};\\\\n\\\\n\\\\t// Execute the module function\\\\n\\\\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\\\\n\\\\n\\\\t// Return the exports of the module\\\\n\\\\treturn module.exports;\\\\n}\\\\n\\\\n// expose the modules object (__webpack_modules__)\\\\n__webpack_require__.m = __webpack_modules__;\\\\n\\\\n\\",\\"// define getter functions for harmony exports\\\\n__webpack_require__.d = (exports, definition) => {\\\\n\\\\tfor(var key in definition) {\\\\n\\\\t\\\\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\\\\n\\\\t\\\\t\\\\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\\\\n\\\\t\\\\t}\\\\n\\\\t}\\\\n};\\",\\"__webpack_require__.f = {};\\\\n// This file contains only the entry chunk.\\\\n// The chunk loading function for additional chunks\\\\n__webpack_require__.e = (chunkId) => {\\\\n\\\\treturn Promise.all(Object.keys(__webpack_require__.f).reduce((promises, key) => {\\\\n\\\\t\\\\t__webpack_require__.f[key](chunkId, promises);\\\\n\\\\t\\\\treturn promises;\\\\n\\\\t}, []));\\\\n};\\",\\"// This function allow to reference async chunks\\\\n__webpack_require__.u = (chunkId) => {\\\\n\\\\t// return url for filenames based on template\\\\n\\\\treturn \\\\\\"\\\\\\" + chunkId + \\\\\\".\\\\\\" + chunkId + \\\\\\".js\\\\\\";\\\\n};\\",\\"__webpack_require__.o = (obj, prop) => Object.prototype.hasOwnProperty.call(obj, prop)\\",\\"// define __esModule on exports\\\\n__webpack_require__.r = (exports) => {\\\\n\\\\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\\\\n\\\\t\\\\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\\\\n\\\\t}\\\\n\\\\tObject.defineProperty(exports, '__esModule', { value: true });\\\\n};\\",\\"__webpack_require__.p = \\\\\\"\\\\\\";\\",\\"// object to store loaded and loading chunks\\\\n// undefined = chunk not loaded, null = chunk preloaded/prefetched\\\\n// Promise = chunk loading, 0 = chunk loaded\\\\nvar installedChunks = {\\\\n\\\\t988: 0\\\\n};\\\\n\\\\n\\\\n__webpack_require__.f.j = (chunkId, promises) => {\\\\n\\\\t\\\\t// JSONP chunk loading for javascript\\\\n\\\\t\\\\tvar installedChunkData = __webpack_require__.o(installedChunks, chunkId) ? installedChunks[chunkId] : undefined;\\\\n\\\\t\\\\tif(installedChunkData !== 0) { // 0 means \\\\\\"already installed\\\\\\".\\\\n\\\\n\\\\t\\\\t\\\\t// a Promise means \\\\\\"currently loading\\\\\\".\\\\n\\\\t\\\\t\\\\tif(installedChunkData) {\\\\n\\\\t\\\\t\\\\t\\\\tpromises.push(installedChunkData[2]);\\\\n\\\\t\\\\t\\\\t} else {\\\\n\\\\t\\\\t\\\\t\\\\tif(true) { // all chunks have JS\\\\n\\\\t\\\\t\\\\t\\\\t\\\\t// setup Promise in chunk cache\\\\n\\\\t\\\\t\\\\t\\\\t\\\\tvar promise = new Promise((resolve, reject) => {\\\\n\\\\t\\\\t\\\\t\\\\t\\\\t\\\\tinstalledChunkData = installedChunks[chunkId] = [resolve, reject];\\\\n\\\\t\\\\t\\\\t\\\\t\\\\t});\\\\n\\\\t\\\\t\\\\t\\\\t\\\\tpromises.push(installedChunkData[2] = promise);\\\\n\\\\n\\\\t\\\\t\\\\t\\\\t\\\\t// start chunk loading\\\\n\\\\t\\\\t\\\\t\\\\t\\\\tvar url = __webpack_require__.p + __webpack_require__.u(chunkId);\\\\n\\\\t\\\\t\\\\t\\\\t\\\\t// create error before stack unwound to get useful stacktrace later\\\\n\\\\t\\\\t\\\\t\\\\t\\\\tvar error = new Error();\\\\n\\\\t\\\\t\\\\t\\\\t\\\\tvar loadingEnded = (event) => {\\\\n\\\\t\\\\t\\\\t\\\\t\\\\t\\\\tif(__webpack_require__.o(installedChunks, chunkId)) {\\\\n\\\\t\\\\t\\\\t\\\\t\\\\t\\\\t\\\\tinstalledChunkData = installedChunks[chunkId];\\\\n\\\\t\\\\t\\\\t\\\\t\\\\t\\\\t\\\\tif(installedChunkData !== 0) installedChunks[chunkId] = undefined;\\\\n\\\\t\\\\t\\\\t\\\\t\\\\t\\\\t\\\\tif(installedChunkData) {\\\\n\\\\t\\\\t\\\\t\\\\t\\\\t\\\\t\\\\t\\\\tvar errorType = event && (event.type === 'load' ? 'missing' : event.type);\\\\n\\\\t\\\\t\\\\t\\\\t\\\\t\\\\t\\\\t\\\\tvar realSrc = event && event.target && event.target.src;\\\\n\\\\t\\\\t\\\\t\\\\t\\\\t\\\\t\\\\t\\\\terror.message = 'Loading chunk ' + chunkId + ' failed.\\\\\\\\n(' + errorType + ': ' + realSrc + ')';\\\\n\\\\t\\\\t\\\\t\\\\t\\\\t\\\\t\\\\t\\\\terror.name = 'ChunkLoadError';\\\\n\\\\t\\\\t\\\\t\\\\t\\\\t\\\\t\\\\t\\\\terror.type = errorType;\\\\n\\\\t\\\\t\\\\t\\\\t\\\\t\\\\t\\\\t\\\\terror.request = realSrc;\\\\n\\\\t\\\\t\\\\t\\\\t\\\\t\\\\t\\\\t\\\\tinstalledChunkData[1](error);\\\\n\\\\t\\\\t\\\\t\\\\t\\\\t\\\\t\\\\t}\\\\n\\\\t\\\\t\\\\t\\\\t\\\\t\\\\t}\\\\n\\\\t\\\\t\\\\t\\\\t\\\\t};\\\\n\\\\t\\\\t\\\\t\\\\t\\\\t__webpack_require__.l(url, loadingEnded, \\\\\\"chunk-\\\\\\" + chunkId);\\\\n\\\\t\\\\t\\\\t\\\\t} else installedChunks[chunkId] = 0;\\\\n\\\\t\\\\t\\\\t}\\\\n\\\\t\\\\t}\\\\n};\\\\n\\\\n// no prefetching\\\\n\\\\n// no preloaded\\\\n\\\\n// no HMR\\\\n\\\\n// no HMR manifest\\\\n\\\\n// no deferred startup\\\\n\\\\n// install a JSONP callback for chunk loading\\\\nvar webpackJsonpCallback = (data) => {\\\\n\\\\tvar [chunkIds, moreModules, runtime] = data;\\\\n\\\\t// add \\\\\\"moreModules\\\\\\" to the modules object,\\\\n\\\\t// then flag all \\\\\\"chunkIds\\\\\\" as loaded and fire callback\\\\n\\\\tvar moduleId, chunkId, i = 0, resolves = [];\\\\n\\\\tfor(;i < chunkIds.length; i++) {\\\\n\\\\t\\\\tchunkId = chunkIds[i];\\\\n\\\\t\\\\tif(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) {\\\\n\\\\t\\\\t\\\\tresolves.push(installedChunks[chunkId][0]);\\\\n\\\\t\\\\t}\\\\n\\\\t\\\\tinstalledChunks[chunkId] = 0;\\\\n\\\\t}\\\\n\\\\tfor(moduleId in moreModules) {\\\\n\\\\t\\\\tif(__webpack_require__.o(moreModules, moduleId)) {\\\\n\\\\t\\\\t\\\\t__webpack_require__.m[moduleId] = moreModules[moduleId];\\\\n\\\\t\\\\t}\\\\n\\\\t}\\\\n\\\\tif(runtime) runtime(__webpack_require__);\\\\n\\\\tparentChunkLoadingFunction(data);\\\\n\\\\twhile(resolves.length) {\\\\n\\\\t\\\\tresolves.shift()();\\\\n\\\\t}\\\\n\\\\n}\\\\n\\\\nvar chunkLoadingGlobal = self[\\\\\\"webpackChunkterser_webpack_plugin\\\\\\"] = self[\\\\\\"webpackChunkterser_webpack_plugin\\\\\\"] || [];\\\\nvar parentChunkLoadingFunction = chunkLoadingGlobal.push.bind(chunkLoadingGlobal);\\\\nchunkLoadingGlobal.push = webpackJsonpCallback;\\",\\"import(\\\\\\"./async-dep\\\\\\").then(() => {\\\\n console.log('Good')\\\\n});\\\\n\\\\nexport default \\\\\\"Awesome\\\\\\";\\\\n\\"],\\"sourceRoot\\":\\"\\"}", + "importExport.js": "(()=>{\\"use strict\\"})(); +//# sourceMappingURL=importExport.js.map", + "importExport.js.map": "{\\"version\\":3,\\"sources\\":[],\\"names\\":[],\\"mappings\\":\\"\\",\\"file\\":\\"importExport.js\\",\\"sourceRoot\\":\\"\\"}", + "js.js": "function changed(){}(()=>{var o={791:o=>{o.exports=function(){console.log(7)}}},r={};!function n(t){if(r[t])return r[t].exports;var e=r[t]={exports:{}};return o[t](e,e.exports,n),e.exports}(791)})(); +//# sourceMappingURL=js.js.map", + "js.js.map": "{\\"version\\":3,\\"sources\\":[\\"webpack://terser-webpack-plugin/./test/fixtures/entry.js\\",\\"webpack://terser-webpack-plugin/webpack/bootstrap\\",\\"webpack://terser-webpack-plugin/webpack/startup\\"],\\"names\\":[\\"module\\",\\"exports\\",\\"console\\",\\"log\\",\\"b\\",\\"__webpack_module_cache__\\",\\"__webpack_require__\\",\\"moduleId\\",\\"__webpack_modules__\\"],\\"mappings\\":\\"yCAKAA,EAAOC,QAAU,WAEfC,QAAQC,IAAIC,MCNVC,EAA2B,IAG/B,SAASC,EAAoBC,GAE5B,GAAGF,EAAyBE,GAC3B,OAAOF,EAAyBE,GAAUN,QAG3C,IAAID,EAASK,EAAyBE,GAAY,CAGjDN,QAAS,IAOV,OAHAO,EAAoBD,GAAUP,EAAQA,EAAOC,QAASK,GAG/CN,EAAOC,QCjBfK,CAAoB,M\\",\\"file\\":\\"js.js\\",\\"sourcesContent\\":[\\"// foo\\\\n/* @preserve*/\\\\n// bar\\\\nconst a = 2 + 2;\\\\n\\\\nmodule.exports = function Foo() {\\\\n const b = 2 + 2;\\\\n console.log(b + 1 + 2);\\\\n};\\\\n\\",\\"// The module cache\\\\nvar __webpack_module_cache__ = {};\\\\n\\\\n// The require function\\\\nfunction __webpack_require__(moduleId) {\\\\n\\\\t// Check if module is in cache\\\\n\\\\tif(__webpack_module_cache__[moduleId]) {\\\\n\\\\t\\\\treturn __webpack_module_cache__[moduleId].exports;\\\\n\\\\t}\\\\n\\\\t// Create a new module (and put it into the cache)\\\\n\\\\tvar module = __webpack_module_cache__[moduleId] = {\\\\n\\\\t\\\\t// no module.id needed\\\\n\\\\t\\\\t// no module.loaded needed\\\\n\\\\t\\\\texports: {}\\\\n\\\\t};\\\\n\\\\n\\\\t// Execute the module function\\\\n\\\\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\\\\n\\\\n\\\\t// Return the exports of the module\\\\n\\\\treturn module.exports;\\\\n}\\\\n\\\\n\\",\\"// startup\\\\n// Load entry module\\\\n// This entry module is referenced by other modules so it can't be inlined\\\\n__webpack_require__(791);\\\\n\\"],\\"sourceRoot\\":\\"\\"}", + "mjs.js": "(()=>{var r={631:r=>{r.exports=function(){console.log(7)}}},o={};!function t(e){if(o[e])return o[e].exports;var n=o[e]={exports:{}};return r[e](n,n.exports,t),n.exports}(631)})(); +//# sourceMappingURL=mjs.js.map", + "mjs.js.map": "{\\"version\\":3,\\"sources\\":[\\"webpack://terser-webpack-plugin/./test/fixtures/entry.mjs\\",\\"webpack://terser-webpack-plugin/webpack/bootstrap\\",\\"webpack://terser-webpack-plugin/webpack/startup\\"],\\"names\\":[\\"module\\",\\"exports\\",\\"console\\",\\"log\\",\\"b\\",\\"__webpack_module_cache__\\",\\"__webpack_require__\\",\\"moduleId\\",\\"__webpack_modules__\\"],\\"mappings\\":\\"qBAKAA,EAAOC,QAAU,WAEfC,QAAQC,IAAIC,MCNVC,EAA2B,IAG/B,SAASC,EAAoBC,GAE5B,GAAGF,EAAyBE,GAC3B,OAAOF,EAAyBE,GAAUN,QAG3C,IAAID,EAASK,EAAyBE,GAAY,CAGjDN,QAAS,IAOV,OAHAO,EAAoBD,GAAUP,EAAQA,EAAOC,QAASK,GAG/CN,EAAOC,QCjBfK,CAAoB,M\\",\\"file\\":\\"mjs.js\\",\\"sourcesContent\\":[\\"// foo\\\\n/* @preserve*/\\\\n// bar\\\\nconst a = 2 + 2;\\\\n\\\\nmodule.exports = function Foo() {\\\\n const b = 2 + 2;\\\\n console.log(b + 1 + 2);\\\\n};\\\\n\\",\\"// The module cache\\\\nvar __webpack_module_cache__ = {};\\\\n\\\\n// The require function\\\\nfunction __webpack_require__(moduleId) {\\\\n\\\\t// Check if module is in cache\\\\n\\\\tif(__webpack_module_cache__[moduleId]) {\\\\n\\\\t\\\\treturn __webpack_module_cache__[moduleId].exports;\\\\n\\\\t}\\\\n\\\\t// Create a new module (and put it into the cache)\\\\n\\\\tvar module = __webpack_module_cache__[moduleId] = {\\\\n\\\\t\\\\t// no module.id needed\\\\n\\\\t\\\\t// no module.loaded needed\\\\n\\\\t\\\\texports: {}\\\\n\\\\t};\\\\n\\\\n\\\\t// Execute the module function\\\\n\\\\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\\\\n\\\\n\\\\t// Return the exports of the module\\\\n\\\\treturn module.exports;\\\\n}\\\\n\\\\n\\",\\"// startup\\\\n// Load entry module\\\\n// This entry module is referenced by other modules so it can't be inlined\\\\n__webpack_require__(631);\\\\n\\"],\\"sourceRoot\\":\\"\\"}", +} +`; + +exports[`TerserPlugin should work with source map and use memory cache when the "cache" option is "true" and the asset has been changed: errors 1`] = `Array []`; + +exports[`TerserPlugin should work with source map and use memory cache when the "cache" option is "true" and the asset has been changed: errors 2`] = `Array []`; + +exports[`TerserPlugin should work with source map and use memory cache when the "cache" option is "true" and the asset has been changed: warnings 1`] = `Array []`; + +exports[`TerserPlugin should work with source map and use memory cache when the "cache" option is "true" and the asset has been changed: warnings 2`] = `Array []`; + +exports[`TerserPlugin should work with source map and use memory cache when the "cache" option is "true": assets 1`] = ` +Object { + "598.598.js": "(self.webpackChunkterser_webpack_plugin=self.webpackChunkterser_webpack_plugin||[]).push([[598],{598:(e,s,p)=>{\\"use strict\\";p.r(s),p.d(s,{default:()=>c});const c=\\"async-dep\\"}}]); +//# sourceMappingURL=598.598.js.map", + "598.598.js.map": "{\\"version\\":3,\\"sources\\":[\\"webpack://terser-webpack-plugin/./test/fixtures/async-import-export/async-dep.js\\"],\\"names\\":[],\\"mappings\\":\\"0JAAA\\",\\"file\\":\\"598.598.js\\",\\"sourcesContent\\":[\\"export default \\\\\\"async-dep\\\\\\";\\\\n\\"],\\"sourceRoot\\":\\"\\"}", + "AsyncImportExport.js": "(()=>{\\"use strict\\";var e,r,t={},o={};function n(e){if(o[e])return o[e].exports;var r=o[e]={exports:{}};return t[e](r,r.exports,n),r.exports}n.m=t,n.d=(e,r)=>{for(var t in r)n.o(r,t)&&!n.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:r[t]})},n.f={},n.e=e=>Promise.all(Object.keys(n.f).reduce((r,t)=>(n.f[t](e,r),r),[])),n.u=e=>e+\\".\\"+e+\\".js\\",n.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),e={},r=\\"terser-webpack-plugin:\\",n.l=(t,o,a)=>{if(e[t])e[t].push(o);else{var i,l;if(void 0!==a)for(var u=document.getElementsByTagName(\\"script\\"),s=0;s{i.onerror=i.onload=null,clearTimeout(c);var n=e[t];if(delete e[t],i.parentNode&&i.parentNode.removeChild(i),n&&n.forEach(e=>e(o)),r)return r(o)},c=setTimeout(d.bind(null,void 0,{type:\\"timeout\\",target:i}),12e4);i.onerror=d.bind(null,i.onerror),i.onload=d.bind(null,i.onload),l&&document.head.appendChild(i)}},n.r=e=>{\\"undefined\\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:\\"Module\\"}),Object.defineProperty(e,\\"__esModule\\",{value:!0})},n.p=\\"\\",(()=>{var e={988:0};n.f.j=(r,t)=>{var o=n.o(e,r)?e[r]:void 0;if(0!==o)if(o)t.push(o[2]);else{var a=new Promise((t,n)=>{o=e[r]=[t,n]});t.push(o[2]=a);var i=n.p+n.u(r),l=new Error;n.l(i,t=>{if(n.o(e,r)&&(0!==(o=e[r])&&(e[r]=void 0),o)){var a=t&&(\\"load\\"===t.type?\\"missing\\":t.type),i=t&&t.target&&t.target.src;l.message=\\"Loading chunk \\"+r+\\" failed.\\\\n(\\"+a+\\": \\"+i+\\")\\",l.name=\\"ChunkLoadError\\",l.type=a,l.request=i,o[1](l)}},\\"chunk-\\"+r)}};var r=self.webpackChunkterser_webpack_plugin=self.webpackChunkterser_webpack_plugin||[],t=r.push.bind(r);r.push=r=>{for(var o,a,[i,l,u]=r,s=0,p=[];s{console.log(\\"Good\\")})})(); +//# sourceMappingURL=AsyncImportExport.js.map", + "AsyncImportExport.js.map": "{\\"version\\":3,\\"sources\\":[\\"webpack://terser-webpack-plugin/webpack/runtime/load script\\",\\"webpack://terser-webpack-plugin/webpack/bootstrap\\",\\"webpack://terser-webpack-plugin/webpack/runtime/define property getters\\",\\"webpack://terser-webpack-plugin/webpack/runtime/ensure chunk\\",\\"webpack://terser-webpack-plugin/webpack/runtime/get javascript chunk filename\\",\\"webpack://terser-webpack-plugin/webpack/runtime/hasOwnProperty shorthand\\",\\"webpack://terser-webpack-plugin/webpack/runtime/make namespace object\\",\\"webpack://terser-webpack-plugin/webpack/runtime/publicPath\\",\\"webpack://terser-webpack-plugin/webpack/runtime/jsonp chunk loading\\",\\"webpack://terser-webpack-plugin/./test/fixtures/async-import-export/entry.js\\"],\\"names\\":[\\"inProgress\\",\\"dataWebpackPrefix\\",\\"__webpack_module_cache__\\",\\"__webpack_require__\\",\\"moduleId\\",\\"exports\\",\\"module\\",\\"__webpack_modules__\\",\\"m\\",\\"d\\",\\"definition\\",\\"key\\",\\"o\\",\\"Object\\",\\"defineProperty\\",\\"enumerable\\",\\"get\\",\\"f\\",\\"e\\",\\"chunkId\\",\\"Promise\\",\\"all\\",\\"keys\\",\\"reduce\\",\\"promises\\",\\"u\\",\\"obj\\",\\"prop\\",\\"prototype\\",\\"hasOwnProperty\\",\\"call\\",\\"l\\",\\"url\\",\\"done\\",\\"push\\",\\"script\\",\\"needAttach\\",\\"undefined\\",\\"scripts\\",\\"document\\",\\"getElementsByTagName\\",\\"i\\",\\"length\\",\\"s\\",\\"getAttribute\\",\\"createElement\\",\\"charset\\",\\"timeout\\",\\"nc\\",\\"setAttribute\\",\\"src\\",\\"onScriptComplete\\",\\"prev\\",\\"event\\",\\"onerror\\",\\"onload\\",\\"clearTimeout\\",\\"doneFns\\",\\"parentNode\\",\\"removeChild\\",\\"forEach\\",\\"fn\\",\\"setTimeout\\",\\"bind\\",\\"type\\",\\"target\\",\\"head\\",\\"appendChild\\",\\"r\\",\\"Symbol\\",\\"toStringTag\\",\\"value\\",\\"p\\",\\"installedChunks\\",\\"988\\",\\"j\\",\\"installedChunkData\\",\\"promise\\",\\"resolve\\",\\"reject\\",\\"error\\",\\"Error\\",\\"errorType\\",\\"realSrc\\",\\"message\\",\\"name\\",\\"request\\",\\"chunkLoadingGlobal\\",\\"self\\",\\"parentChunkLoadingFunction\\",\\"data\\",\\"chunkIds\\",\\"moreModules\\",\\"runtime\\",\\"resolves\\",\\"shift\\",\\"then\\",\\"console\\",\\"log\\"],\\"mappings\\":\\"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\\",\\"file\\":\\"AsyncImportExport.js\\",\\"sourcesContent\\":[\\"var inProgress = {};\\\\nvar dataWebpackPrefix = \\\\\\"terser-webpack-plugin:\\\\\\";\\\\n// loadScript function to load a script via script tag\\\\n__webpack_require__.l = (url, done, key) => {\\\\n\\\\tif(inProgress[url]) { inProgress[url].push(done); return; }\\\\n\\\\tvar script, needAttach;\\\\n\\\\tif(key !== undefined) {\\\\n\\\\t\\\\tvar scripts = document.getElementsByTagName(\\\\\\"script\\\\\\");\\\\n\\\\t\\\\tfor(var i = 0; i < scripts.length; i++) {\\\\n\\\\t\\\\t\\\\tvar s = scripts[i];\\\\n\\\\t\\\\t\\\\tif(s.getAttribute(\\\\\\"src\\\\\\") == url || s.getAttribute(\\\\\\"data-webpack\\\\\\") == dataWebpackPrefix + key) { script = s; break; }\\\\n\\\\t\\\\t}\\\\n\\\\t}\\\\n\\\\tif(!script) {\\\\n\\\\t\\\\tneedAttach = true;\\\\n\\\\t\\\\tscript = document.createElement('script');\\\\n\\\\n\\\\t\\\\tscript.charset = 'utf-8';\\\\n\\\\t\\\\tscript.timeout = 120;\\\\n\\\\t\\\\tif (__webpack_require__.nc) {\\\\n\\\\t\\\\t\\\\tscript.setAttribute(\\\\\\"nonce\\\\\\", __webpack_require__.nc);\\\\n\\\\t\\\\t}\\\\n\\\\t\\\\tscript.setAttribute(\\\\\\"data-webpack\\\\\\", dataWebpackPrefix + key);\\\\n\\\\t\\\\tscript.src = url;\\\\n\\\\t}\\\\n\\\\tinProgress[url] = [done];\\\\n\\\\tvar onScriptComplete = (prev, event) => {\\\\n\\\\t\\\\t// avoid mem leaks in IE.\\\\n\\\\t\\\\tscript.onerror = script.onload = null;\\\\n\\\\t\\\\tclearTimeout(timeout);\\\\n\\\\t\\\\tvar doneFns = inProgress[url];\\\\n\\\\t\\\\tdelete inProgress[url];\\\\n\\\\t\\\\tscript.parentNode && script.parentNode.removeChild(script);\\\\n\\\\t\\\\tdoneFns && doneFns.forEach((fn) => fn(event));\\\\n\\\\t\\\\tif(prev) return prev(event);\\\\n\\\\t}\\\\n\\\\t;\\\\n\\\\tvar timeout = setTimeout(onScriptComplete.bind(null, undefined, { type: 'timeout', target: script }), 120000);\\\\n\\\\tscript.onerror = onScriptComplete.bind(null, script.onerror);\\\\n\\\\tscript.onload = onScriptComplete.bind(null, script.onload);\\\\n\\\\tneedAttach && document.head.appendChild(script);\\\\n};\\",\\"// The module cache\\\\nvar __webpack_module_cache__ = {};\\\\n\\\\n// The require function\\\\nfunction __webpack_require__(moduleId) {\\\\n\\\\t// Check if module is in cache\\\\n\\\\tif(__webpack_module_cache__[moduleId]) {\\\\n\\\\t\\\\treturn __webpack_module_cache__[moduleId].exports;\\\\n\\\\t}\\\\n\\\\t// Create a new module (and put it into the cache)\\\\n\\\\tvar module = __webpack_module_cache__[moduleId] = {\\\\n\\\\t\\\\t// no module.id needed\\\\n\\\\t\\\\t// no module.loaded needed\\\\n\\\\t\\\\texports: {}\\\\n\\\\t};\\\\n\\\\n\\\\t// Execute the module function\\\\n\\\\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\\\\n\\\\n\\\\t// Return the exports of the module\\\\n\\\\treturn module.exports;\\\\n}\\\\n\\\\n// expose the modules object (__webpack_modules__)\\\\n__webpack_require__.m = __webpack_modules__;\\\\n\\\\n\\",\\"// define getter functions for harmony exports\\\\n__webpack_require__.d = (exports, definition) => {\\\\n\\\\tfor(var key in definition) {\\\\n\\\\t\\\\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\\\\n\\\\t\\\\t\\\\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\\\\n\\\\t\\\\t}\\\\n\\\\t}\\\\n};\\",\\"__webpack_require__.f = {};\\\\n// This file contains only the entry chunk.\\\\n// The chunk loading function for additional chunks\\\\n__webpack_require__.e = (chunkId) => {\\\\n\\\\treturn Promise.all(Object.keys(__webpack_require__.f).reduce((promises, key) => {\\\\n\\\\t\\\\t__webpack_require__.f[key](chunkId, promises);\\\\n\\\\t\\\\treturn promises;\\\\n\\\\t}, []));\\\\n};\\",\\"// This function allow to reference async chunks\\\\n__webpack_require__.u = (chunkId) => {\\\\n\\\\t// return url for filenames based on template\\\\n\\\\treturn \\\\\\"\\\\\\" + chunkId + \\\\\\".\\\\\\" + chunkId + \\\\\\".js\\\\\\";\\\\n};\\",\\"__webpack_require__.o = (obj, prop) => Object.prototype.hasOwnProperty.call(obj, prop)\\",\\"// define __esModule on exports\\\\n__webpack_require__.r = (exports) => {\\\\n\\\\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\\\\n\\\\t\\\\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\\\\n\\\\t}\\\\n\\\\tObject.defineProperty(exports, '__esModule', { value: true });\\\\n};\\",\\"__webpack_require__.p = \\\\\\"\\\\\\";\\",\\"// object to store loaded and loading chunks\\\\n// undefined = chunk not loaded, null = chunk preloaded/prefetched\\\\n// Promise = chunk loading, 0 = chunk loaded\\\\nvar installedChunks = {\\\\n\\\\t988: 0\\\\n};\\\\n\\\\n\\\\n__webpack_require__.f.j = (chunkId, promises) => {\\\\n\\\\t\\\\t// JSONP chunk loading for javascript\\\\n\\\\t\\\\tvar installedChunkData = __webpack_require__.o(installedChunks, chunkId) ? installedChunks[chunkId] : undefined;\\\\n\\\\t\\\\tif(installedChunkData !== 0) { // 0 means \\\\\\"already installed\\\\\\".\\\\n\\\\n\\\\t\\\\t\\\\t// a Promise means \\\\\\"currently loading\\\\\\".\\\\n\\\\t\\\\t\\\\tif(installedChunkData) {\\\\n\\\\t\\\\t\\\\t\\\\tpromises.push(installedChunkData[2]);\\\\n\\\\t\\\\t\\\\t} else {\\\\n\\\\t\\\\t\\\\t\\\\tif(true) { // all chunks have JS\\\\n\\\\t\\\\t\\\\t\\\\t\\\\t// setup Promise in chunk cache\\\\n\\\\t\\\\t\\\\t\\\\t\\\\tvar promise = new Promise((resolve, reject) => {\\\\n\\\\t\\\\t\\\\t\\\\t\\\\t\\\\tinstalledChunkData = installedChunks[chunkId] = [resolve, reject];\\\\n\\\\t\\\\t\\\\t\\\\t\\\\t});\\\\n\\\\t\\\\t\\\\t\\\\t\\\\tpromises.push(installedChunkData[2] = promise);\\\\n\\\\n\\\\t\\\\t\\\\t\\\\t\\\\t// start chunk loading\\\\n\\\\t\\\\t\\\\t\\\\t\\\\tvar url = __webpack_require__.p + __webpack_require__.u(chunkId);\\\\n\\\\t\\\\t\\\\t\\\\t\\\\t// create error before stack unwound to get useful stacktrace later\\\\n\\\\t\\\\t\\\\t\\\\t\\\\tvar error = new Error();\\\\n\\\\t\\\\t\\\\t\\\\t\\\\tvar loadingEnded = (event) => {\\\\n\\\\t\\\\t\\\\t\\\\t\\\\t\\\\tif(__webpack_require__.o(installedChunks, chunkId)) {\\\\n\\\\t\\\\t\\\\t\\\\t\\\\t\\\\t\\\\tinstalledChunkData = installedChunks[chunkId];\\\\n\\\\t\\\\t\\\\t\\\\t\\\\t\\\\t\\\\tif(installedChunkData !== 0) installedChunks[chunkId] = undefined;\\\\n\\\\t\\\\t\\\\t\\\\t\\\\t\\\\t\\\\tif(installedChunkData) {\\\\n\\\\t\\\\t\\\\t\\\\t\\\\t\\\\t\\\\t\\\\tvar errorType = event && (event.type === 'load' ? 'missing' : event.type);\\\\n\\\\t\\\\t\\\\t\\\\t\\\\t\\\\t\\\\t\\\\tvar realSrc = event && event.target && event.target.src;\\\\n\\\\t\\\\t\\\\t\\\\t\\\\t\\\\t\\\\t\\\\terror.message = 'Loading chunk ' + chunkId + ' failed.\\\\\\\\n(' + errorType + ': ' + realSrc + ')';\\\\n\\\\t\\\\t\\\\t\\\\t\\\\t\\\\t\\\\t\\\\terror.name = 'ChunkLoadError';\\\\n\\\\t\\\\t\\\\t\\\\t\\\\t\\\\t\\\\t\\\\terror.type = errorType;\\\\n\\\\t\\\\t\\\\t\\\\t\\\\t\\\\t\\\\t\\\\terror.request = realSrc;\\\\n\\\\t\\\\t\\\\t\\\\t\\\\t\\\\t\\\\t\\\\tinstalledChunkData[1](error);\\\\n\\\\t\\\\t\\\\t\\\\t\\\\t\\\\t\\\\t}\\\\n\\\\t\\\\t\\\\t\\\\t\\\\t\\\\t}\\\\n\\\\t\\\\t\\\\t\\\\t\\\\t};\\\\n\\\\t\\\\t\\\\t\\\\t\\\\t__webpack_require__.l(url, loadingEnded, \\\\\\"chunk-\\\\\\" + chunkId);\\\\n\\\\t\\\\t\\\\t\\\\t} else installedChunks[chunkId] = 0;\\\\n\\\\t\\\\t\\\\t}\\\\n\\\\t\\\\t}\\\\n};\\\\n\\\\n// no prefetching\\\\n\\\\n// no preloaded\\\\n\\\\n// no HMR\\\\n\\\\n// no HMR manifest\\\\n\\\\n// no deferred startup\\\\n\\\\n// install a JSONP callback for chunk loading\\\\nvar webpackJsonpCallback = (data) => {\\\\n\\\\tvar [chunkIds, moreModules, runtime] = data;\\\\n\\\\t// add \\\\\\"moreModules\\\\\\" to the modules object,\\\\n\\\\t// then flag all \\\\\\"chunkIds\\\\\\" as loaded and fire callback\\\\n\\\\tvar moduleId, chunkId, i = 0, resolves = [];\\\\n\\\\tfor(;i < chunkIds.length; i++) {\\\\n\\\\t\\\\tchunkId = chunkIds[i];\\\\n\\\\t\\\\tif(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) {\\\\n\\\\t\\\\t\\\\tresolves.push(installedChunks[chunkId][0]);\\\\n\\\\t\\\\t}\\\\n\\\\t\\\\tinstalledChunks[chunkId] = 0;\\\\n\\\\t}\\\\n\\\\tfor(moduleId in moreModules) {\\\\n\\\\t\\\\tif(__webpack_require__.o(moreModules, moduleId)) {\\\\n\\\\t\\\\t\\\\t__webpack_require__.m[moduleId] = moreModules[moduleId];\\\\n\\\\t\\\\t}\\\\n\\\\t}\\\\n\\\\tif(runtime) runtime(__webpack_require__);\\\\n\\\\tparentChunkLoadingFunction(data);\\\\n\\\\twhile(resolves.length) {\\\\n\\\\t\\\\tresolves.shift()();\\\\n\\\\t}\\\\n\\\\n}\\\\n\\\\nvar chunkLoadingGlobal = self[\\\\\\"webpackChunkterser_webpack_plugin\\\\\\"] = self[\\\\\\"webpackChunkterser_webpack_plugin\\\\\\"] || [];\\\\nvar parentChunkLoadingFunction = chunkLoadingGlobal.push.bind(chunkLoadingGlobal);\\\\nchunkLoadingGlobal.push = webpackJsonpCallback;\\",\\"import(\\\\\\"./async-dep\\\\\\").then(() => {\\\\n console.log('Good')\\\\n});\\\\n\\\\nexport default \\\\\\"Awesome\\\\\\";\\\\n\\"],\\"sourceRoot\\":\\"\\"}", + "importExport.js": "(()=>{\\"use strict\\"})(); +//# sourceMappingURL=importExport.js.map", + "importExport.js.map": "{\\"version\\":3,\\"sources\\":[],\\"names\\":[],\\"mappings\\":\\"\\",\\"file\\":\\"importExport.js\\",\\"sourceRoot\\":\\"\\"}", + "js.js": "(()=>{var r={791:r=>{r.exports=function(){console.log(7)}}},o={};!function t(e){if(o[e])return o[e].exports;var n=o[e]={exports:{}};return r[e](n,n.exports,t),n.exports}(791)})(); +//# sourceMappingURL=js.js.map", + "js.js.map": "{\\"version\\":3,\\"sources\\":[\\"webpack://terser-webpack-plugin/./test/fixtures/entry.js\\",\\"webpack://terser-webpack-plugin/webpack/bootstrap\\",\\"webpack://terser-webpack-plugin/webpack/startup\\"],\\"names\\":[\\"module\\",\\"exports\\",\\"console\\",\\"log\\",\\"b\\",\\"__webpack_module_cache__\\",\\"__webpack_require__\\",\\"moduleId\\",\\"__webpack_modules__\\"],\\"mappings\\":\\"qBAKAA,EAAOC,QAAU,WAEfC,QAAQC,IAAIC,MCNVC,EAA2B,IAG/B,SAASC,EAAoBC,GAE5B,GAAGF,EAAyBE,GAC3B,OAAOF,EAAyBE,GAAUN,QAG3C,IAAID,EAASK,EAAyBE,GAAY,CAGjDN,QAAS,IAOV,OAHAO,EAAoBD,GAAUP,EAAQA,EAAOC,QAASK,GAG/CN,EAAOC,QCjBfK,CAAoB,M\\",\\"file\\":\\"js.js\\",\\"sourcesContent\\":[\\"// foo\\\\n/* @preserve*/\\\\n// bar\\\\nconst a = 2 + 2;\\\\n\\\\nmodule.exports = function Foo() {\\\\n const b = 2 + 2;\\\\n console.log(b + 1 + 2);\\\\n};\\\\n\\",\\"// The module cache\\\\nvar __webpack_module_cache__ = {};\\\\n\\\\n// The require function\\\\nfunction __webpack_require__(moduleId) {\\\\n\\\\t// Check if module is in cache\\\\n\\\\tif(__webpack_module_cache__[moduleId]) {\\\\n\\\\t\\\\treturn __webpack_module_cache__[moduleId].exports;\\\\n\\\\t}\\\\n\\\\t// Create a new module (and put it into the cache)\\\\n\\\\tvar module = __webpack_module_cache__[moduleId] = {\\\\n\\\\t\\\\t// no module.id needed\\\\n\\\\t\\\\t// no module.loaded needed\\\\n\\\\t\\\\texports: {}\\\\n\\\\t};\\\\n\\\\n\\\\t// Execute the module function\\\\n\\\\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\\\\n\\\\n\\\\t// Return the exports of the module\\\\n\\\\treturn module.exports;\\\\n}\\\\n\\\\n\\",\\"// startup\\\\n// Load entry module\\\\n// This entry module is referenced by other modules so it can't be inlined\\\\n__webpack_require__(791);\\\\n\\"],\\"sourceRoot\\":\\"\\"}", + "mjs.js": "(()=>{var r={631:r=>{r.exports=function(){console.log(7)}}},o={};!function t(e){if(o[e])return o[e].exports;var n=o[e]={exports:{}};return r[e](n,n.exports,t),n.exports}(631)})(); +//# sourceMappingURL=mjs.js.map", + "mjs.js.map": "{\\"version\\":3,\\"sources\\":[\\"webpack://terser-webpack-plugin/./test/fixtures/entry.mjs\\",\\"webpack://terser-webpack-plugin/webpack/bootstrap\\",\\"webpack://terser-webpack-plugin/webpack/startup\\"],\\"names\\":[\\"module\\",\\"exports\\",\\"console\\",\\"log\\",\\"b\\",\\"__webpack_module_cache__\\",\\"__webpack_require__\\",\\"moduleId\\",\\"__webpack_modules__\\"],\\"mappings\\":\\"qBAKAA,EAAOC,QAAU,WAEfC,QAAQC,IAAIC,MCNVC,EAA2B,IAG/B,SAASC,EAAoBC,GAE5B,GAAGF,EAAyBE,GAC3B,OAAOF,EAAyBE,GAAUN,QAG3C,IAAID,EAASK,EAAyBE,GAAY,CAGjDN,QAAS,IAOV,OAHAO,EAAoBD,GAAUP,EAAQA,EAAOC,QAASK,GAG/CN,EAAOC,QCjBfK,CAAoB,M\\",\\"file\\":\\"mjs.js\\",\\"sourcesContent\\":[\\"// foo\\\\n/* @preserve*/\\\\n// bar\\\\nconst a = 2 + 2;\\\\n\\\\nmodule.exports = function Foo() {\\\\n const b = 2 + 2;\\\\n console.log(b + 1 + 2);\\\\n};\\\\n\\",\\"// The module cache\\\\nvar __webpack_module_cache__ = {};\\\\n\\\\n// The require function\\\\nfunction __webpack_require__(moduleId) {\\\\n\\\\t// Check if module is in cache\\\\n\\\\tif(__webpack_module_cache__[moduleId]) {\\\\n\\\\t\\\\treturn __webpack_module_cache__[moduleId].exports;\\\\n\\\\t}\\\\n\\\\t// Create a new module (and put it into the cache)\\\\n\\\\tvar module = __webpack_module_cache__[moduleId] = {\\\\n\\\\t\\\\t// no module.id needed\\\\n\\\\t\\\\t// no module.loaded needed\\\\n\\\\t\\\\texports: {}\\\\n\\\\t};\\\\n\\\\n\\\\t// Execute the module function\\\\n\\\\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\\\\n\\\\n\\\\t// Return the exports of the module\\\\n\\\\treturn module.exports;\\\\n}\\\\n\\\\n\\",\\"// startup\\\\n// Load entry module\\\\n// This entry module is referenced by other modules so it can't be inlined\\\\n__webpack_require__(631);\\\\n\\"],\\"sourceRoot\\":\\"\\"}", +} +`; + +exports[`TerserPlugin should work with source map and use memory cache when the "cache" option is "true": assets 2`] = ` +Object { + "598.598.js": "(self.webpackChunkterser_webpack_plugin=self.webpackChunkterser_webpack_plugin||[]).push([[598],{598:(e,s,p)=>{\\"use strict\\";p.r(s),p.d(s,{default:()=>c});const c=\\"async-dep\\"}}]); +//# sourceMappingURL=598.598.js.map", + "598.598.js.map": "{\\"version\\":3,\\"sources\\":[\\"webpack://terser-webpack-plugin/./test/fixtures/async-import-export/async-dep.js\\"],\\"names\\":[],\\"mappings\\":\\"0JAAA\\",\\"file\\":\\"598.598.js\\",\\"sourcesContent\\":[\\"export default \\\\\\"async-dep\\\\\\";\\\\n\\"],\\"sourceRoot\\":\\"\\"}", + "AsyncImportExport.js": "(()=>{\\"use strict\\";var e,r,t={},o={};function n(e){if(o[e])return o[e].exports;var r=o[e]={exports:{}};return t[e](r,r.exports,n),r.exports}n.m=t,n.d=(e,r)=>{for(var t in r)n.o(r,t)&&!n.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:r[t]})},n.f={},n.e=e=>Promise.all(Object.keys(n.f).reduce((r,t)=>(n.f[t](e,r),r),[])),n.u=e=>e+\\".\\"+e+\\".js\\",n.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),e={},r=\\"terser-webpack-plugin:\\",n.l=(t,o,a)=>{if(e[t])e[t].push(o);else{var i,l;if(void 0!==a)for(var u=document.getElementsByTagName(\\"script\\"),s=0;s{i.onerror=i.onload=null,clearTimeout(c);var n=e[t];if(delete e[t],i.parentNode&&i.parentNode.removeChild(i),n&&n.forEach(e=>e(o)),r)return r(o)},c=setTimeout(d.bind(null,void 0,{type:\\"timeout\\",target:i}),12e4);i.onerror=d.bind(null,i.onerror),i.onload=d.bind(null,i.onload),l&&document.head.appendChild(i)}},n.r=e=>{\\"undefined\\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:\\"Module\\"}),Object.defineProperty(e,\\"__esModule\\",{value:!0})},n.p=\\"\\",(()=>{var e={988:0};n.f.j=(r,t)=>{var o=n.o(e,r)?e[r]:void 0;if(0!==o)if(o)t.push(o[2]);else{var a=new Promise((t,n)=>{o=e[r]=[t,n]});t.push(o[2]=a);var i=n.p+n.u(r),l=new Error;n.l(i,t=>{if(n.o(e,r)&&(0!==(o=e[r])&&(e[r]=void 0),o)){var a=t&&(\\"load\\"===t.type?\\"missing\\":t.type),i=t&&t.target&&t.target.src;l.message=\\"Loading chunk \\"+r+\\" failed.\\\\n(\\"+a+\\": \\"+i+\\")\\",l.name=\\"ChunkLoadError\\",l.type=a,l.request=i,o[1](l)}},\\"chunk-\\"+r)}};var r=self.webpackChunkterser_webpack_plugin=self.webpackChunkterser_webpack_plugin||[],t=r.push.bind(r);r.push=r=>{for(var o,a,[i,l,u]=r,s=0,p=[];s{console.log(\\"Good\\")})})(); +//# sourceMappingURL=AsyncImportExport.js.map", + "AsyncImportExport.js.map": "{\\"version\\":3,\\"sources\\":[\\"webpack://terser-webpack-plugin/webpack/runtime/load script\\",\\"webpack://terser-webpack-plugin/webpack/bootstrap\\",\\"webpack://terser-webpack-plugin/webpack/runtime/define property getters\\",\\"webpack://terser-webpack-plugin/webpack/runtime/ensure chunk\\",\\"webpack://terser-webpack-plugin/webpack/runtime/get javascript chunk filename\\",\\"webpack://terser-webpack-plugin/webpack/runtime/hasOwnProperty shorthand\\",\\"webpack://terser-webpack-plugin/webpack/runtime/make namespace object\\",\\"webpack://terser-webpack-plugin/webpack/runtime/publicPath\\",\\"webpack://terser-webpack-plugin/webpack/runtime/jsonp chunk loading\\",\\"webpack://terser-webpack-plugin/./test/fixtures/async-import-export/entry.js\\"],\\"names\\":[\\"inProgress\\",\\"dataWebpackPrefix\\",\\"__webpack_module_cache__\\",\\"__webpack_require__\\",\\"moduleId\\",\\"exports\\",\\"module\\",\\"__webpack_modules__\\",\\"m\\",\\"d\\",\\"definition\\",\\"key\\",\\"o\\",\\"Object\\",\\"defineProperty\\",\\"enumerable\\",\\"get\\",\\"f\\",\\"e\\",\\"chunkId\\",\\"Promise\\",\\"all\\",\\"keys\\",\\"reduce\\",\\"promises\\",\\"u\\",\\"obj\\",\\"prop\\",\\"prototype\\",\\"hasOwnProperty\\",\\"call\\",\\"l\\",\\"url\\",\\"done\\",\\"push\\",\\"script\\",\\"needAttach\\",\\"undefined\\",\\"scripts\\",\\"document\\",\\"getElementsByTagName\\",\\"i\\",\\"length\\",\\"s\\",\\"getAttribute\\",\\"createElement\\",\\"charset\\",\\"timeout\\",\\"nc\\",\\"setAttribute\\",\\"src\\",\\"onScriptComplete\\",\\"prev\\",\\"event\\",\\"onerror\\",\\"onload\\",\\"clearTimeout\\",\\"doneFns\\",\\"parentNode\\",\\"removeChild\\",\\"forEach\\",\\"fn\\",\\"setTimeout\\",\\"bind\\",\\"type\\",\\"target\\",\\"head\\",\\"appendChild\\",\\"r\\",\\"Symbol\\",\\"toStringTag\\",\\"value\\",\\"p\\",\\"installedChunks\\",\\"988\\",\\"j\\",\\"installedChunkData\\",\\"promise\\",\\"resolve\\",\\"reject\\",\\"error\\",\\"Error\\",\\"errorType\\",\\"realSrc\\",\\"message\\",\\"name\\",\\"request\\",\\"chunkLoadingGlobal\\",\\"self\\",\\"parentChunkLoadingFunction\\",\\"data\\",\\"chunkIds\\",\\"moreModules\\",\\"runtime\\",\\"resolves\\",\\"shift\\",\\"then\\",\\"console\\",\\"log\\"],\\"mappings\\":\\"uBAAIA,EACAC,E,KCAAC,EAA2B,GAG/B,SAASC,EAAoBC,GAE5B,GAAGF,EAAyBE,GAC3B,OAAOF,EAAyBE,GAAUC,QAG3C,IAAIC,EAASJ,EAAyBE,GAAY,CAGjDC,QAAS,IAOV,OAHAE,EAAoBH,GAAUE,EAAQA,EAAOD,QAASF,GAG/CG,EAAOD,QAIfF,EAAoBK,EAAID,ECvBxBJ,EAAoBM,EAAI,CAACJ,EAASK,KACjC,IAAI,IAAIC,KAAOD,EACXP,EAAoBS,EAAEF,EAAYC,KAASR,EAAoBS,EAAEP,EAASM,IAC5EE,OAAOC,eAAeT,EAASM,EAAK,CAAEI,YAAY,EAAMC,IAAKN,EAAWC,MCJ3ER,EAAoBc,EAAI,GAGxBd,EAAoBe,EAAKC,GACjBC,QAAQC,IAAIR,OAAOS,KAAKnB,EAAoBc,GAAGM,OAAO,CAACC,EAAUb,KACvER,EAAoBc,EAAEN,GAAKQ,EAASK,GAC7BA,GACL,KCNJrB,EAAoBsB,EAAKN,GAEZA,EAAU,IAAMA,EAAU,MCHvChB,EAAoBS,EAAI,CAACc,EAAKC,IAASd,OAAOe,UAAUC,eAAeC,KAAKJ,EAAKC,GLA7E3B,EAAa,GACbC,EAAoB,yBAExBE,EAAoB4B,EAAI,CAACC,EAAKC,EAAMtB,KACnC,GAAGX,EAAWgC,GAAQhC,EAAWgC,GAAKE,KAAKD,OAA3C,CACA,IAAIE,EAAQC,EACZ,QAAWC,IAAR1B,EAEF,IADA,IAAI2B,EAAUC,SAASC,qBAAqB,UACpCC,EAAI,EAAGA,EAAIH,EAAQI,OAAQD,IAAK,CACvC,IAAIE,EAAIL,EAAQG,GAChB,GAAGE,EAAEC,aAAa,QAAUZ,GAAOW,EAAEC,aAAa,iBAAmB3C,EAAoBU,EAAK,CAAEwB,EAASQ,EAAG,OAG1GR,IACHC,GAAa,GACbD,EAASI,SAASM,cAAc,WAEzBC,QAAU,QACjBX,EAAOY,QAAU,IACb5C,EAAoB6C,IACvBb,EAAOc,aAAa,QAAS9C,EAAoB6C,IAElDb,EAAOc,aAAa,eAAgBhD,EAAoBU,GACxDwB,EAAOe,IAAMlB,GAEdhC,EAAWgC,GAAO,CAACC,GACnB,IAAIkB,EAAmB,CAACC,EAAMC,KAE7BlB,EAAOmB,QAAUnB,EAAOoB,OAAS,KACjCC,aAAaT,GACb,IAAIU,EAAUzD,EAAWgC,GAIzB,UAHOhC,EAAWgC,GAClBG,EAAOuB,YAAcvB,EAAOuB,WAAWC,YAAYxB,GACnDsB,GAAWA,EAAQG,QAASC,GAAOA,EAAGR,IACnCD,EAAM,OAAOA,EAAKC,IAGlBN,EAAUe,WAAWX,EAAiBY,KAAK,UAAM1B,EAAW,CAAE2B,KAAM,UAAWC,OAAQ9B,IAAW,MACtGA,EAAOmB,QAAUH,EAAiBY,KAAK,KAAM5B,EAAOmB,SACpDnB,EAAOoB,OAASJ,EAAiBY,KAAK,KAAM5B,EAAOoB,QACnDnB,GAAcG,SAAS2B,KAAKC,YAAYhC,KMvCzChC,EAAoBiE,EAAK/D,IACH,oBAAXgE,QAA0BA,OAAOC,aAC1CzD,OAAOC,eAAeT,EAASgE,OAAOC,YAAa,CAAEC,MAAO,WAE7D1D,OAAOC,eAAeT,EAAS,aAAc,CAAEkE,OAAO,KCLvDpE,EAAoBqE,EAAI,G,MCGxB,IAAIC,EAAkB,CACrBC,IAAK,GAINvE,EAAoBc,EAAE0D,EAAI,CAACxD,EAASK,KAElC,IAAIoD,EAAqBzE,EAAoBS,EAAE6D,EAAiBtD,GAAWsD,EAAgBtD,QAAWkB,EACtG,GAA0B,IAAvBuC,EAGF,GAAGA,EACFpD,EAASU,KAAK0C,EAAmB,QAC3B,CAGL,IAAIC,EAAU,IAAIzD,QAAQ,CAAC0D,EAASC,KACnCH,EAAqBH,EAAgBtD,GAAW,CAAC2D,EAASC,KAE3DvD,EAASU,KAAK0C,EAAmB,GAAKC,GAGtC,IAAI7C,EAAM7B,EAAoBqE,EAAIrE,EAAoBsB,EAAEN,GAEpD6D,EAAQ,IAAIC,MAgBhB9E,EAAoB4B,EAAEC,EAfFqB,IACnB,GAAGlD,EAAoBS,EAAE6D,EAAiBtD,KAEf,KAD1ByD,EAAqBH,EAAgBtD,MACRsD,EAAgBtD,QAAWkB,GACrDuC,GAAoB,CACtB,IAAIM,EAAY7B,IAAyB,SAAfA,EAAMW,KAAkB,UAAYX,EAAMW,MAChEmB,EAAU9B,GAASA,EAAMY,QAAUZ,EAAMY,OAAOf,IACpD8B,EAAMI,QAAU,iBAAmBjE,EAAU,cAAgB+D,EAAY,KAAOC,EAAU,IAC1FH,EAAMK,KAAO,iBACbL,EAAMhB,KAAOkB,EACbF,EAAMM,QAAUH,EAChBP,EAAmB,GAAGI,KAIgB,SAAW7D,KAiBzD,IAyBIoE,EAAqBC,KAAwC,kCAAIA,KAAwC,mCAAK,GAC9GC,EAA6BF,EAAmBrD,KAAK6B,KAAKwB,GAC9DA,EAAmBrD,KA3BSwD,IAK3B,IAJA,IAGItF,EAAUe,GAHTwE,EAAUC,EAAaC,GAAWH,EAGhBjD,EAAI,EAAGqD,EAAW,GACpCrD,EAAIkD,EAASjD,OAAQD,IACzBtB,EAAUwE,EAASlD,GAChBtC,EAAoBS,EAAE6D,EAAiBtD,IAAYsD,EAAgBtD,IACrE2E,EAAS5D,KAAKuC,EAAgBtD,GAAS,IAExCsD,EAAgBtD,GAAW,EAE5B,IAAIf,KAAYwF,EACZzF,EAAoBS,EAAEgF,EAAaxF,KACrCD,EAAoBK,EAAEJ,GAAYwF,EAAYxF,IAKhD,IAFGyF,GAASA,EAAQ1F,GACpBsF,EAA2BC,GACrBI,EAASpD,QACdoD,EAASC,OAATD,K,GChFF,6BAAsBE,KAAK,KACzBC,QAAQC,IAAI,W\\",\\"file\\":\\"AsyncImportExport.js\\",\\"sourcesContent\\":[\\"var inProgress = {};\\\\nvar dataWebpackPrefix = \\\\\\"terser-webpack-plugin:\\\\\\";\\\\n// loadScript function to load a script via script tag\\\\n__webpack_require__.l = (url, done, key) => {\\\\n\\\\tif(inProgress[url]) { inProgress[url].push(done); return; }\\\\n\\\\tvar script, needAttach;\\\\n\\\\tif(key !== undefined) {\\\\n\\\\t\\\\tvar scripts = document.getElementsByTagName(\\\\\\"script\\\\\\");\\\\n\\\\t\\\\tfor(var i = 0; i < scripts.length; i++) {\\\\n\\\\t\\\\t\\\\tvar s = scripts[i];\\\\n\\\\t\\\\t\\\\tif(s.getAttribute(\\\\\\"src\\\\\\") == url || s.getAttribute(\\\\\\"data-webpack\\\\\\") == dataWebpackPrefix + key) { script = s; break; }\\\\n\\\\t\\\\t}\\\\n\\\\t}\\\\n\\\\tif(!script) {\\\\n\\\\t\\\\tneedAttach = true;\\\\n\\\\t\\\\tscript = document.createElement('script');\\\\n\\\\n\\\\t\\\\tscript.charset = 'utf-8';\\\\n\\\\t\\\\tscript.timeout = 120;\\\\n\\\\t\\\\tif (__webpack_require__.nc) {\\\\n\\\\t\\\\t\\\\tscript.setAttribute(\\\\\\"nonce\\\\\\", __webpack_require__.nc);\\\\n\\\\t\\\\t}\\\\n\\\\t\\\\tscript.setAttribute(\\\\\\"data-webpack\\\\\\", dataWebpackPrefix + key);\\\\n\\\\t\\\\tscript.src = url;\\\\n\\\\t}\\\\n\\\\tinProgress[url] = [done];\\\\n\\\\tvar onScriptComplete = (prev, event) => {\\\\n\\\\t\\\\t// avoid mem leaks in IE.\\\\n\\\\t\\\\tscript.onerror = script.onload = null;\\\\n\\\\t\\\\tclearTimeout(timeout);\\\\n\\\\t\\\\tvar doneFns = inProgress[url];\\\\n\\\\t\\\\tdelete inProgress[url];\\\\n\\\\t\\\\tscript.parentNode && script.parentNode.removeChild(script);\\\\n\\\\t\\\\tdoneFns && doneFns.forEach((fn) => fn(event));\\\\n\\\\t\\\\tif(prev) return prev(event);\\\\n\\\\t}\\\\n\\\\t;\\\\n\\\\tvar timeout = setTimeout(onScriptComplete.bind(null, undefined, { type: 'timeout', target: script }), 120000);\\\\n\\\\tscript.onerror = onScriptComplete.bind(null, script.onerror);\\\\n\\\\tscript.onload = onScriptComplete.bind(null, script.onload);\\\\n\\\\tneedAttach && document.head.appendChild(script);\\\\n};\\",\\"// The module cache\\\\nvar __webpack_module_cache__ = {};\\\\n\\\\n// The require function\\\\nfunction __webpack_require__(moduleId) {\\\\n\\\\t// Check if module is in cache\\\\n\\\\tif(__webpack_module_cache__[moduleId]) {\\\\n\\\\t\\\\treturn __webpack_module_cache__[moduleId].exports;\\\\n\\\\t}\\\\n\\\\t// Create a new module (and put it into the cache)\\\\n\\\\tvar module = __webpack_module_cache__[moduleId] = {\\\\n\\\\t\\\\t// no module.id needed\\\\n\\\\t\\\\t// no module.loaded needed\\\\n\\\\t\\\\texports: {}\\\\n\\\\t};\\\\n\\\\n\\\\t// Execute the module function\\\\n\\\\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\\\\n\\\\n\\\\t// Return the exports of the module\\\\n\\\\treturn module.exports;\\\\n}\\\\n\\\\n// expose the modules object (__webpack_modules__)\\\\n__webpack_require__.m = __webpack_modules__;\\\\n\\\\n\\",\\"// define getter functions for harmony exports\\\\n__webpack_require__.d = (exports, definition) => {\\\\n\\\\tfor(var key in definition) {\\\\n\\\\t\\\\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\\\\n\\\\t\\\\t\\\\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\\\\n\\\\t\\\\t}\\\\n\\\\t}\\\\n};\\",\\"__webpack_require__.f = {};\\\\n// This file contains only the entry chunk.\\\\n// The chunk loading function for additional chunks\\\\n__webpack_require__.e = (chunkId) => {\\\\n\\\\treturn Promise.all(Object.keys(__webpack_require__.f).reduce((promises, key) => {\\\\n\\\\t\\\\t__webpack_require__.f[key](chunkId, promises);\\\\n\\\\t\\\\treturn promises;\\\\n\\\\t}, []));\\\\n};\\",\\"// This function allow to reference async chunks\\\\n__webpack_require__.u = (chunkId) => {\\\\n\\\\t// return url for filenames based on template\\\\n\\\\treturn \\\\\\"\\\\\\" + chunkId + \\\\\\".\\\\\\" + chunkId + \\\\\\".js\\\\\\";\\\\n};\\",\\"__webpack_require__.o = (obj, prop) => Object.prototype.hasOwnProperty.call(obj, prop)\\",\\"// define __esModule on exports\\\\n__webpack_require__.r = (exports) => {\\\\n\\\\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\\\\n\\\\t\\\\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\\\\n\\\\t}\\\\n\\\\tObject.defineProperty(exports, '__esModule', { value: true });\\\\n};\\",\\"__webpack_require__.p = \\\\\\"\\\\\\";\\",\\"// object to store loaded and loading chunks\\\\n// undefined = chunk not loaded, null = chunk preloaded/prefetched\\\\n// Promise = chunk loading, 0 = chunk loaded\\\\nvar installedChunks = {\\\\n\\\\t988: 0\\\\n};\\\\n\\\\n\\\\n__webpack_require__.f.j = (chunkId, promises) => {\\\\n\\\\t\\\\t// JSONP chunk loading for javascript\\\\n\\\\t\\\\tvar installedChunkData = __webpack_require__.o(installedChunks, chunkId) ? installedChunks[chunkId] : undefined;\\\\n\\\\t\\\\tif(installedChunkData !== 0) { // 0 means \\\\\\"already installed\\\\\\".\\\\n\\\\n\\\\t\\\\t\\\\t// a Promise means \\\\\\"currently loading\\\\\\".\\\\n\\\\t\\\\t\\\\tif(installedChunkData) {\\\\n\\\\t\\\\t\\\\t\\\\tpromises.push(installedChunkData[2]);\\\\n\\\\t\\\\t\\\\t} else {\\\\n\\\\t\\\\t\\\\t\\\\tif(true) { // all chunks have JS\\\\n\\\\t\\\\t\\\\t\\\\t\\\\t// setup Promise in chunk cache\\\\n\\\\t\\\\t\\\\t\\\\t\\\\tvar promise = new Promise((resolve, reject) => {\\\\n\\\\t\\\\t\\\\t\\\\t\\\\t\\\\tinstalledChunkData = installedChunks[chunkId] = [resolve, reject];\\\\n\\\\t\\\\t\\\\t\\\\t\\\\t});\\\\n\\\\t\\\\t\\\\t\\\\t\\\\tpromises.push(installedChunkData[2] = promise);\\\\n\\\\n\\\\t\\\\t\\\\t\\\\t\\\\t// start chunk loading\\\\n\\\\t\\\\t\\\\t\\\\t\\\\tvar url = __webpack_require__.p + __webpack_require__.u(chunkId);\\\\n\\\\t\\\\t\\\\t\\\\t\\\\t// create error before stack unwound to get useful stacktrace later\\\\n\\\\t\\\\t\\\\t\\\\t\\\\tvar error = new Error();\\\\n\\\\t\\\\t\\\\t\\\\t\\\\tvar loadingEnded = (event) => {\\\\n\\\\t\\\\t\\\\t\\\\t\\\\t\\\\tif(__webpack_require__.o(installedChunks, chunkId)) {\\\\n\\\\t\\\\t\\\\t\\\\t\\\\t\\\\t\\\\tinstalledChunkData = installedChunks[chunkId];\\\\n\\\\t\\\\t\\\\t\\\\t\\\\t\\\\t\\\\tif(installedChunkData !== 0) installedChunks[chunkId] = undefined;\\\\n\\\\t\\\\t\\\\t\\\\t\\\\t\\\\t\\\\tif(installedChunkData) {\\\\n\\\\t\\\\t\\\\t\\\\t\\\\t\\\\t\\\\t\\\\tvar errorType = event && (event.type === 'load' ? 'missing' : event.type);\\\\n\\\\t\\\\t\\\\t\\\\t\\\\t\\\\t\\\\t\\\\tvar realSrc = event && event.target && event.target.src;\\\\n\\\\t\\\\t\\\\t\\\\t\\\\t\\\\t\\\\t\\\\terror.message = 'Loading chunk ' + chunkId + ' failed.\\\\\\\\n(' + errorType + ': ' + realSrc + ')';\\\\n\\\\t\\\\t\\\\t\\\\t\\\\t\\\\t\\\\t\\\\terror.name = 'ChunkLoadError';\\\\n\\\\t\\\\t\\\\t\\\\t\\\\t\\\\t\\\\t\\\\terror.type = errorType;\\\\n\\\\t\\\\t\\\\t\\\\t\\\\t\\\\t\\\\t\\\\terror.request = realSrc;\\\\n\\\\t\\\\t\\\\t\\\\t\\\\t\\\\t\\\\t\\\\tinstalledChunkData[1](error);\\\\n\\\\t\\\\t\\\\t\\\\t\\\\t\\\\t\\\\t}\\\\n\\\\t\\\\t\\\\t\\\\t\\\\t\\\\t}\\\\n\\\\t\\\\t\\\\t\\\\t\\\\t};\\\\n\\\\t\\\\t\\\\t\\\\t\\\\t__webpack_require__.l(url, loadingEnded, \\\\\\"chunk-\\\\\\" + chunkId);\\\\n\\\\t\\\\t\\\\t\\\\t} else installedChunks[chunkId] = 0;\\\\n\\\\t\\\\t\\\\t}\\\\n\\\\t\\\\t}\\\\n};\\\\n\\\\n// no prefetching\\\\n\\\\n// no preloaded\\\\n\\\\n// no HMR\\\\n\\\\n// no HMR manifest\\\\n\\\\n// no deferred startup\\\\n\\\\n// install a JSONP callback for chunk loading\\\\nvar webpackJsonpCallback = (data) => {\\\\n\\\\tvar [chunkIds, moreModules, runtime] = data;\\\\n\\\\t// add \\\\\\"moreModules\\\\\\" to the modules object,\\\\n\\\\t// then flag all \\\\\\"chunkIds\\\\\\" as loaded and fire callback\\\\n\\\\tvar moduleId, chunkId, i = 0, resolves = [];\\\\n\\\\tfor(;i < chunkIds.length; i++) {\\\\n\\\\t\\\\tchunkId = chunkIds[i];\\\\n\\\\t\\\\tif(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) {\\\\n\\\\t\\\\t\\\\tresolves.push(installedChunks[chunkId][0]);\\\\n\\\\t\\\\t}\\\\n\\\\t\\\\tinstalledChunks[chunkId] = 0;\\\\n\\\\t}\\\\n\\\\tfor(moduleId in moreModules) {\\\\n\\\\t\\\\tif(__webpack_require__.o(moreModules, moduleId)) {\\\\n\\\\t\\\\t\\\\t__webpack_require__.m[moduleId] = moreModules[moduleId];\\\\n\\\\t\\\\t}\\\\n\\\\t}\\\\n\\\\tif(runtime) runtime(__webpack_require__);\\\\n\\\\tparentChunkLoadingFunction(data);\\\\n\\\\twhile(resolves.length) {\\\\n\\\\t\\\\tresolves.shift()();\\\\n\\\\t}\\\\n\\\\n}\\\\n\\\\nvar chunkLoadingGlobal = self[\\\\\\"webpackChunkterser_webpack_plugin\\\\\\"] = self[\\\\\\"webpackChunkterser_webpack_plugin\\\\\\"] || [];\\\\nvar parentChunkLoadingFunction = chunkLoadingGlobal.push.bind(chunkLoadingGlobal);\\\\nchunkLoadingGlobal.push = webpackJsonpCallback;\\",\\"import(\\\\\\"./async-dep\\\\\\").then(() => {\\\\n console.log('Good')\\\\n});\\\\n\\\\nexport default \\\\\\"Awesome\\\\\\";\\\\n\\"],\\"sourceRoot\\":\\"\\"}", + "importExport.js": "(()=>{\\"use strict\\"})(); +//# sourceMappingURL=importExport.js.map", + "importExport.js.map": "{\\"version\\":3,\\"sources\\":[],\\"names\\":[],\\"mappings\\":\\"\\",\\"file\\":\\"importExport.js\\",\\"sourceRoot\\":\\"\\"}", + "js.js": "(()=>{var r={791:r=>{r.exports=function(){console.log(7)}}},o={};!function t(e){if(o[e])return o[e].exports;var n=o[e]={exports:{}};return r[e](n,n.exports,t),n.exports}(791)})(); +//# sourceMappingURL=js.js.map", + "js.js.map": "{\\"version\\":3,\\"sources\\":[\\"webpack://terser-webpack-plugin/./test/fixtures/entry.js\\",\\"webpack://terser-webpack-plugin/webpack/bootstrap\\",\\"webpack://terser-webpack-plugin/webpack/startup\\"],\\"names\\":[\\"module\\",\\"exports\\",\\"console\\",\\"log\\",\\"b\\",\\"__webpack_module_cache__\\",\\"__webpack_require__\\",\\"moduleId\\",\\"__webpack_modules__\\"],\\"mappings\\":\\"qBAKAA,EAAOC,QAAU,WAEfC,QAAQC,IAAIC,MCNVC,EAA2B,IAG/B,SAASC,EAAoBC,GAE5B,GAAGF,EAAyBE,GAC3B,OAAOF,EAAyBE,GAAUN,QAG3C,IAAID,EAASK,EAAyBE,GAAY,CAGjDN,QAAS,IAOV,OAHAO,EAAoBD,GAAUP,EAAQA,EAAOC,QAASK,GAG/CN,EAAOC,QCjBfK,CAAoB,M\\",\\"file\\":\\"js.js\\",\\"sourcesContent\\":[\\"// foo\\\\n/* @preserve*/\\\\n// bar\\\\nconst a = 2 + 2;\\\\n\\\\nmodule.exports = function Foo() {\\\\n const b = 2 + 2;\\\\n console.log(b + 1 + 2);\\\\n};\\\\n\\",\\"// The module cache\\\\nvar __webpack_module_cache__ = {};\\\\n\\\\n// The require function\\\\nfunction __webpack_require__(moduleId) {\\\\n\\\\t// Check if module is in cache\\\\n\\\\tif(__webpack_module_cache__[moduleId]) {\\\\n\\\\t\\\\treturn __webpack_module_cache__[moduleId].exports;\\\\n\\\\t}\\\\n\\\\t// Create a new module (and put it into the cache)\\\\n\\\\tvar module = __webpack_module_cache__[moduleId] = {\\\\n\\\\t\\\\t// no module.id needed\\\\n\\\\t\\\\t// no module.loaded needed\\\\n\\\\t\\\\texports: {}\\\\n\\\\t};\\\\n\\\\n\\\\t// Execute the module function\\\\n\\\\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\\\\n\\\\n\\\\t// Return the exports of the module\\\\n\\\\treturn module.exports;\\\\n}\\\\n\\\\n\\",\\"// startup\\\\n// Load entry module\\\\n// This entry module is referenced by other modules so it can't be inlined\\\\n__webpack_require__(791);\\\\n\\"],\\"sourceRoot\\":\\"\\"}", + "mjs.js": "(()=>{var r={631:r=>{r.exports=function(){console.log(7)}}},o={};!function t(e){if(o[e])return o[e].exports;var n=o[e]={exports:{}};return r[e](n,n.exports,t),n.exports}(631)})(); +//# sourceMappingURL=mjs.js.map", + "mjs.js.map": "{\\"version\\":3,\\"sources\\":[\\"webpack://terser-webpack-plugin/./test/fixtures/entry.mjs\\",\\"webpack://terser-webpack-plugin/webpack/bootstrap\\",\\"webpack://terser-webpack-plugin/webpack/startup\\"],\\"names\\":[\\"module\\",\\"exports\\",\\"console\\",\\"log\\",\\"b\\",\\"__webpack_module_cache__\\",\\"__webpack_require__\\",\\"moduleId\\",\\"__webpack_modules__\\"],\\"mappings\\":\\"qBAKAA,EAAOC,QAAU,WAEfC,QAAQC,IAAIC,MCNVC,EAA2B,IAG/B,SAASC,EAAoBC,GAE5B,GAAGF,EAAyBE,GAC3B,OAAOF,EAAyBE,GAAUN,QAG3C,IAAID,EAASK,EAAyBE,GAAY,CAGjDN,QAAS,IAOV,OAHAO,EAAoBD,GAAUP,EAAQA,EAAOC,QAASK,GAG/CN,EAAOC,QCjBfK,CAAoB,M\\",\\"file\\":\\"mjs.js\\",\\"sourcesContent\\":[\\"// foo\\\\n/* @preserve*/\\\\n// bar\\\\nconst a = 2 + 2;\\\\n\\\\nmodule.exports = function Foo() {\\\\n const b = 2 + 2;\\\\n console.log(b + 1 + 2);\\\\n};\\\\n\\",\\"// The module cache\\\\nvar __webpack_module_cache__ = {};\\\\n\\\\n// The require function\\\\nfunction __webpack_require__(moduleId) {\\\\n\\\\t// Check if module is in cache\\\\n\\\\tif(__webpack_module_cache__[moduleId]) {\\\\n\\\\t\\\\treturn __webpack_module_cache__[moduleId].exports;\\\\n\\\\t}\\\\n\\\\t// Create a new module (and put it into the cache)\\\\n\\\\tvar module = __webpack_module_cache__[moduleId] = {\\\\n\\\\t\\\\t// no module.id needed\\\\n\\\\t\\\\t// no module.loaded needed\\\\n\\\\t\\\\texports: {}\\\\n\\\\t};\\\\n\\\\n\\\\t// Execute the module function\\\\n\\\\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\\\\n\\\\n\\\\t// Return the exports of the module\\\\n\\\\treturn module.exports;\\\\n}\\\\n\\\\n\\",\\"// startup\\\\n// Load entry module\\\\n// This entry module is referenced by other modules so it can't be inlined\\\\n__webpack_require__(631);\\\\n\\"],\\"sourceRoot\\":\\"\\"}", +} +`; + +exports[`TerserPlugin should work with source map and use memory cache when the "cache" option is "true": errors 1`] = `Array []`; + +exports[`TerserPlugin should work with source map and use memory cache when the "cache" option is "true": errors 2`] = `Array []`; + +exports[`TerserPlugin should work with source map and use memory cache when the "cache" option is "true": warnings 1`] = `Array []`; + +exports[`TerserPlugin should work with source map and use memory cache when the "cache" option is "true": warnings 2`] = `Array []`; + +exports[`TerserPlugin should work, extract comments in different files and use memory cache memory cache when the "cache" option is "true" and the asset has been changed: assets 1`] = ` +Object { + "627.627.js": "/*! For license information please see 627.627.js.LICENSE.txt */ +(self.webpackChunkterser_webpack_plugin=self.webpackChunkterser_webpack_plugin||[]).push([[627],{627:e=>{e.exports=Math.random()}}]);", + "627.627.js.LICENSE.txt": "/*! Legal Comment */ + +/** @license Copyright 2112 Moon. **/ +", + "four.js": "/*! For license information please see four.js.LICENSE.txt */ +(()=>{var r={712:r=>{r.exports=Math.random()}},t={};!function e(o){if(t[o])return t[o].exports;var n=t[o]={exports:{}};return r[o](n,n.exports,e),n.exports}(712)})();", + "four.js.LICENSE.txt": "/** + * Duplicate comment in difference files. + * @license MIT + */ +", + "one.js": "/*! For license information please see one.js.LICENSE.txt */ +(()=>{var e,r,t={900:(e,r,t)=>{t.e(627).then(t.t.bind(t,627,7)),e.exports=Math.random()}},o={};function n(e){if(o[e])return o[e].exports;var r=o[e]={exports:{}};return t[e](r,r.exports,n),r.exports}n.m=t,n.t=function(e,r){if(1&r&&(e=this(e)),8&r)return e;if(4&r&&\\"object\\"==typeof e&&e&&e.__esModule)return e;var t=Object.create(null);n.r(t);var o={};if(2&r&&\\"object\\"==typeof e&&e)for(const r in e)o[r]=()=>e[r];return o.default=()=>e,n.d(t,o),t},n.d=(e,r)=>{for(var t in r)n.o(r,t)&&!n.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:r[t]})},n.f={},n.e=e=>Promise.all(Object.keys(n.f).reduce((r,t)=>(n.f[t](e,r),r),[])),n.u=e=>e+\\".\\"+e+\\".js\\",n.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),e={},r=\\"terser-webpack-plugin:\\",n.l=(t,o,a)=>{if(e[t])e[t].push(o);else{var i,u;if(void 0!==a)for(var l=document.getElementsByTagName(\\"script\\"),s=0;s{i.onerror=i.onload=null,clearTimeout(c);var n=e[t];if(delete e[t],i.parentNode&&i.parentNode.removeChild(i),n&&n.forEach(e=>e(o)),r)return r(o)},c=setTimeout(d.bind(null,void 0,{type:\\"timeout\\",target:i}),12e4);i.onerror=d.bind(null,i.onerror),i.onload=d.bind(null,i.onload),u&&document.head.appendChild(i)}},n.r=e=>{\\"undefined\\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:\\"Module\\"}),Object.defineProperty(e,\\"__esModule\\",{value:!0})},n.p=\\"\\",(()=>{var e={255:0};n.f.j=(r,t)=>{var o=n.o(e,r)?e[r]:void 0;if(0!==o)if(o)t.push(o[2]);else{var a=new Promise((t,n)=>{o=e[r]=[t,n]});t.push(o[2]=a);var i=n.p+n.u(r),u=new Error;n.l(i,t=>{if(n.o(e,r)&&(0!==(o=e[r])&&(e[r]=void 0),o)){var a=t&&(\\"load\\"===t.type?\\"missing\\":t.type),i=t&&t.target&&t.target.src;u.message=\\"Loading chunk \\"+r+\\" failed.\\\\n(\\"+a+\\": \\"+i+\\")\\",u.name=\\"ChunkLoadError\\",u.type=a,u.request=i,o[1](u)}},\\"chunk-\\"+r)}};var r=self.webpackChunkterser_webpack_plugin=self.webpackChunkterser_webpack_plugin||[],t=r.push.bind(r);r.push=r=>{for(var o,a,[i,u,l]=r,s=0,p=[];s{var r={787:r=>{r.exports=Math.random()}},t={};!function e(o){if(t[o])return t[o].exports;var n=t[o]={exports:{}};return r[o](n,n.exports,e),n.exports}(787)})();", + "three.js.LICENSE.txt": "/** + * Duplicate comment in difference files. + * @license MIT + */ + +/** + * Duplicate comment in same file. + * @license MIT + */ +", + "two.js": "/*! For license information please see two.js.LICENSE.txt */ +(()=>{var r={353:r=>{r.exports=Math.random()}},t={};!function e(o){if(t[o])return t[o].exports;var n=t[o]={exports:{}};return r[o](n,n.exports,e),n.exports}(353)})();", + "two.js.LICENSE.txt": "/** + * Information. + * @license MIT + */ +", +} +`; + +exports[`TerserPlugin should work, extract comments in different files and use memory cache memory cache when the "cache" option is "true" and the asset has been changed: assets 2`] = ` +Object { + "627.627.js": "/*! For license information please see 627.627.js.LICENSE.txt */ +(self.webpackChunkterser_webpack_plugin=self.webpackChunkterser_webpack_plugin||[]).push([[627],{627:e=>{e.exports=Math.random()}}]);", + "627.627.js.LICENSE.txt": "/*! Legal Comment */ + +/** @license Copyright 2112 Moon. **/ +", + "four.js": "/*! For license information please see four.js.LICENSE.txt */ +(()=>{var r={712:r=>{r.exports=Math.random()}},t={};!function e(o){if(t[o])return t[o].exports;var n=t[o]={exports:{}};return r[o](n,n.exports,e),n.exports}(712)})();", + "four.js.LICENSE.txt": "/** + * Duplicate comment in difference files. + * @license MIT + */ +", + "one.js": "/*! For license information please see one.js.LICENSE.txt */ +(()=>{var e,r,t={900:(e,r,t)=>{t.e(627).then(t.t.bind(t,627,7)),e.exports=Math.random()}},o={};function n(e){if(o[e])return o[e].exports;var r=o[e]={exports:{}};return t[e](r,r.exports,n),r.exports}n.m=t,n.t=function(e,r){if(1&r&&(e=this(e)),8&r)return e;if(4&r&&\\"object\\"==typeof e&&e&&e.__esModule)return e;var t=Object.create(null);n.r(t);var o={};if(2&r&&\\"object\\"==typeof e&&e)for(const r in e)o[r]=()=>e[r];return o.default=()=>e,n.d(t,o),t},n.d=(e,r)=>{for(var t in r)n.o(r,t)&&!n.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:r[t]})},n.f={},n.e=e=>Promise.all(Object.keys(n.f).reduce((r,t)=>(n.f[t](e,r),r),[])),n.u=e=>e+\\".\\"+e+\\".js\\",n.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),e={},r=\\"terser-webpack-plugin:\\",n.l=(t,o,a)=>{if(e[t])e[t].push(o);else{var i,u;if(void 0!==a)for(var l=document.getElementsByTagName(\\"script\\"),s=0;s{i.onerror=i.onload=null,clearTimeout(c);var n=e[t];if(delete e[t],i.parentNode&&i.parentNode.removeChild(i),n&&n.forEach(e=>e(o)),r)return r(o)},c=setTimeout(d.bind(null,void 0,{type:\\"timeout\\",target:i}),12e4);i.onerror=d.bind(null,i.onerror),i.onload=d.bind(null,i.onload),u&&document.head.appendChild(i)}},n.r=e=>{\\"undefined\\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:\\"Module\\"}),Object.defineProperty(e,\\"__esModule\\",{value:!0})},n.p=\\"\\",(()=>{var e={255:0};n.f.j=(r,t)=>{var o=n.o(e,r)?e[r]:void 0;if(0!==o)if(o)t.push(o[2]);else{var a=new Promise((t,n)=>{o=e[r]=[t,n]});t.push(o[2]=a);var i=n.p+n.u(r),u=new Error;n.l(i,t=>{if(n.o(e,r)&&(0!==(o=e[r])&&(e[r]=void 0),o)){var a=t&&(\\"load\\"===t.type?\\"missing\\":t.type),i=t&&t.target&&t.target.src;u.message=\\"Loading chunk \\"+r+\\" failed.\\\\n(\\"+a+\\": \\"+i+\\")\\",u.name=\\"ChunkLoadError\\",u.type=a,u.request=i,o[1](u)}},\\"chunk-\\"+r)}};var r=self.webpackChunkterser_webpack_plugin=self.webpackChunkterser_webpack_plugin||[],t=r.push.bind(r);r.push=r=>{for(var o,a,[i,u,l]=r,s=0,p=[];s{var r={787:r=>{r.exports=Math.random()}},t={};!function e(o){if(t[o])return t[o].exports;var n=t[o]={exports:{}};return r[o](n,n.exports,e),n.exports}(787)})();", + "three.js.LICENSE.txt": "/** + * Duplicate comment in difference files. + * @license MIT + */ + +/** + * Duplicate comment in same file. + * @license MIT + */ +", + "two.js": "/*! For license information please see two.js.LICENSE.txt */ +function changed(){}(()=>{var r={353:r=>{r.exports=Math.random()}},t={};!function e(n){if(t[n])return t[n].exports;var o=t[n]={exports:{}};return r[n](o,o.exports,e),o.exports}(353)})();", + "two.js.LICENSE.txt": "/*! CHANGED */ + +/** + * Information. + * @license MIT + */ +", +} +`; + +exports[`TerserPlugin should work, extract comments in different files and use memory cache memory cache when the "cache" option is "true" and the asset has been changed: errors 1`] = `Array []`; + +exports[`TerserPlugin should work, extract comments in different files and use memory cache memory cache when the "cache" option is "true" and the asset has been changed: errors 2`] = `Array []`; + +exports[`TerserPlugin should work, extract comments in different files and use memory cache memory cache when the "cache" option is "true" and the asset has been changed: warnings 1`] = `Array []`; + +exports[`TerserPlugin should work, extract comments in different files and use memory cache memory cache when the "cache" option is "true" and the asset has been changed: warnings 2`] = `Array []`; + +exports[`TerserPlugin should work, extract comments in different files and use memory cache memory cache when the "cache" option is "true": assets 1`] = ` +Object { + "627.627.js": "/*! For license information please see 627.627.js.LICENSE.txt */ +(self.webpackChunkterser_webpack_plugin=self.webpackChunkterser_webpack_plugin||[]).push([[627],{627:e=>{e.exports=Math.random()}}]);", + "627.627.js.LICENSE.txt": "/*! Legal Comment */ + +/** @license Copyright 2112 Moon. **/ +", + "four.js": "/*! For license information please see four.js.LICENSE.txt */ +(()=>{var r={712:r=>{r.exports=Math.random()}},t={};!function e(o){if(t[o])return t[o].exports;var n=t[o]={exports:{}};return r[o](n,n.exports,e),n.exports}(712)})();", + "four.js.LICENSE.txt": "/** + * Duplicate comment in difference files. + * @license MIT + */ +", + "one.js": "/*! For license information please see one.js.LICENSE.txt */ +(()=>{var e,r,t={900:(e,r,t)=>{t.e(627).then(t.t.bind(t,627,7)),e.exports=Math.random()}},o={};function n(e){if(o[e])return o[e].exports;var r=o[e]={exports:{}};return t[e](r,r.exports,n),r.exports}n.m=t,n.t=function(e,r){if(1&r&&(e=this(e)),8&r)return e;if(4&r&&\\"object\\"==typeof e&&e&&e.__esModule)return e;var t=Object.create(null);n.r(t);var o={};if(2&r&&\\"object\\"==typeof e&&e)for(const r in e)o[r]=()=>e[r];return o.default=()=>e,n.d(t,o),t},n.d=(e,r)=>{for(var t in r)n.o(r,t)&&!n.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:r[t]})},n.f={},n.e=e=>Promise.all(Object.keys(n.f).reduce((r,t)=>(n.f[t](e,r),r),[])),n.u=e=>e+\\".\\"+e+\\".js\\",n.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),e={},r=\\"terser-webpack-plugin:\\",n.l=(t,o,a)=>{if(e[t])e[t].push(o);else{var i,u;if(void 0!==a)for(var l=document.getElementsByTagName(\\"script\\"),s=0;s{i.onerror=i.onload=null,clearTimeout(c);var n=e[t];if(delete e[t],i.parentNode&&i.parentNode.removeChild(i),n&&n.forEach(e=>e(o)),r)return r(o)},c=setTimeout(d.bind(null,void 0,{type:\\"timeout\\",target:i}),12e4);i.onerror=d.bind(null,i.onerror),i.onload=d.bind(null,i.onload),u&&document.head.appendChild(i)}},n.r=e=>{\\"undefined\\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:\\"Module\\"}),Object.defineProperty(e,\\"__esModule\\",{value:!0})},n.p=\\"\\",(()=>{var e={255:0};n.f.j=(r,t)=>{var o=n.o(e,r)?e[r]:void 0;if(0!==o)if(o)t.push(o[2]);else{var a=new Promise((t,n)=>{o=e[r]=[t,n]});t.push(o[2]=a);var i=n.p+n.u(r),u=new Error;n.l(i,t=>{if(n.o(e,r)&&(0!==(o=e[r])&&(e[r]=void 0),o)){var a=t&&(\\"load\\"===t.type?\\"missing\\":t.type),i=t&&t.target&&t.target.src;u.message=\\"Loading chunk \\"+r+\\" failed.\\\\n(\\"+a+\\": \\"+i+\\")\\",u.name=\\"ChunkLoadError\\",u.type=a,u.request=i,o[1](u)}},\\"chunk-\\"+r)}};var r=self.webpackChunkterser_webpack_plugin=self.webpackChunkterser_webpack_plugin||[],t=r.push.bind(r);r.push=r=>{for(var o,a,[i,u,l]=r,s=0,p=[];s{var r={787:r=>{r.exports=Math.random()}},t={};!function e(o){if(t[o])return t[o].exports;var n=t[o]={exports:{}};return r[o](n,n.exports,e),n.exports}(787)})();", + "three.js.LICENSE.txt": "/** + * Duplicate comment in difference files. + * @license MIT + */ + +/** + * Duplicate comment in same file. + * @license MIT + */ +", + "two.js": "/*! For license information please see two.js.LICENSE.txt */ +(()=>{var r={353:r=>{r.exports=Math.random()}},t={};!function e(o){if(t[o])return t[o].exports;var n=t[o]={exports:{}};return r[o](n,n.exports,e),n.exports}(353)})();", + "two.js.LICENSE.txt": "/** + * Information. + * @license MIT + */ +", +} +`; + +exports[`TerserPlugin should work, extract comments in different files and use memory cache memory cache when the "cache" option is "true": assets 2`] = ` +Object { + "627.627.js": "/*! For license information please see 627.627.js.LICENSE.txt */ +(self.webpackChunkterser_webpack_plugin=self.webpackChunkterser_webpack_plugin||[]).push([[627],{627:e=>{e.exports=Math.random()}}]);", + "627.627.js.LICENSE.txt": "/*! Legal Comment */ + +/** @license Copyright 2112 Moon. **/ +", + "four.js": "/*! For license information please see four.js.LICENSE.txt */ +(()=>{var r={712:r=>{r.exports=Math.random()}},t={};!function e(o){if(t[o])return t[o].exports;var n=t[o]={exports:{}};return r[o](n,n.exports,e),n.exports}(712)})();", + "four.js.LICENSE.txt": "/** + * Duplicate comment in difference files. + * @license MIT + */ +", + "one.js": "/*! For license information please see one.js.LICENSE.txt */ +(()=>{var e,r,t={900:(e,r,t)=>{t.e(627).then(t.t.bind(t,627,7)),e.exports=Math.random()}},o={};function n(e){if(o[e])return o[e].exports;var r=o[e]={exports:{}};return t[e](r,r.exports,n),r.exports}n.m=t,n.t=function(e,r){if(1&r&&(e=this(e)),8&r)return e;if(4&r&&\\"object\\"==typeof e&&e&&e.__esModule)return e;var t=Object.create(null);n.r(t);var o={};if(2&r&&\\"object\\"==typeof e&&e)for(const r in e)o[r]=()=>e[r];return o.default=()=>e,n.d(t,o),t},n.d=(e,r)=>{for(var t in r)n.o(r,t)&&!n.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:r[t]})},n.f={},n.e=e=>Promise.all(Object.keys(n.f).reduce((r,t)=>(n.f[t](e,r),r),[])),n.u=e=>e+\\".\\"+e+\\".js\\",n.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),e={},r=\\"terser-webpack-plugin:\\",n.l=(t,o,a)=>{if(e[t])e[t].push(o);else{var i,u;if(void 0!==a)for(var l=document.getElementsByTagName(\\"script\\"),s=0;s{i.onerror=i.onload=null,clearTimeout(c);var n=e[t];if(delete e[t],i.parentNode&&i.parentNode.removeChild(i),n&&n.forEach(e=>e(o)),r)return r(o)},c=setTimeout(d.bind(null,void 0,{type:\\"timeout\\",target:i}),12e4);i.onerror=d.bind(null,i.onerror),i.onload=d.bind(null,i.onload),u&&document.head.appendChild(i)}},n.r=e=>{\\"undefined\\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:\\"Module\\"}),Object.defineProperty(e,\\"__esModule\\",{value:!0})},n.p=\\"\\",(()=>{var e={255:0};n.f.j=(r,t)=>{var o=n.o(e,r)?e[r]:void 0;if(0!==o)if(o)t.push(o[2]);else{var a=new Promise((t,n)=>{o=e[r]=[t,n]});t.push(o[2]=a);var i=n.p+n.u(r),u=new Error;n.l(i,t=>{if(n.o(e,r)&&(0!==(o=e[r])&&(e[r]=void 0),o)){var a=t&&(\\"load\\"===t.type?\\"missing\\":t.type),i=t&&t.target&&t.target.src;u.message=\\"Loading chunk \\"+r+\\" failed.\\\\n(\\"+a+\\": \\"+i+\\")\\",u.name=\\"ChunkLoadError\\",u.type=a,u.request=i,o[1](u)}},\\"chunk-\\"+r)}};var r=self.webpackChunkterser_webpack_plugin=self.webpackChunkterser_webpack_plugin||[],t=r.push.bind(r);r.push=r=>{for(var o,a,[i,u,l]=r,s=0,p=[];s{var r={787:r=>{r.exports=Math.random()}},t={};!function e(o){if(t[o])return t[o].exports;var n=t[o]={exports:{}};return r[o](n,n.exports,e),n.exports}(787)})();", + "three.js.LICENSE.txt": "/** + * Duplicate comment in difference files. + * @license MIT + */ + +/** + * Duplicate comment in same file. + * @license MIT + */ +", + "two.js": "/*! For license information please see two.js.LICENSE.txt */ +(()=>{var r={353:r=>{r.exports=Math.random()}},t={};!function e(o){if(t[o])return t[o].exports;var n=t[o]={exports:{}};return r[o](n,n.exports,e),n.exports}(353)})();", + "two.js.LICENSE.txt": "/** + * Information. + * @license MIT + */ +", +} +`; + +exports[`TerserPlugin should work, extract comments in different files and use memory cache memory cache when the "cache" option is "true": errors 1`] = `Array []`; + +exports[`TerserPlugin should work, extract comments in different files and use memory cache memory cache when the "cache" option is "true": errors 2`] = `Array []`; + +exports[`TerserPlugin should work, extract comments in different files and use memory cache memory cache when the "cache" option is "true": warnings 1`] = `Array []`; + +exports[`TerserPlugin should work, extract comments in different files and use memory cache memory cache when the "cache" option is "true": warnings 2`] = `Array []`; + +exports[`TerserPlugin should work, extract comments in one file and use memory cache memory cache when the "cache" option is "true" and the asset has been changed: assets 1`] = ` +Object { + "627.627.js": "/*! For license information please see licenses.txt */ +(self.webpackChunkterser_webpack_plugin=self.webpackChunkterser_webpack_plugin||[]).push([[627],{627:e=>{e.exports=Math.random()}}]);", + "four.js": "/*! For license information please see licenses.txt */ +(()=>{var r={712:r=>{r.exports=Math.random()}},t={};!function e(o){if(t[o])return t[o].exports;var n=t[o]={exports:{}};return r[o](n,n.exports,e),n.exports}(712)})();", + "licenses.txt": "/*! Legal Comment */ + +/** @license Copyright 2112 Moon. **/ + + +/** + * Duplicate comment in difference files. + * @license MIT + */ + + +/*! Legal Foo */ + +/** + * @preserve Copyright 2009 SomeThirdParty. + * Here is the full license text and copyright + * notice for this file. Note that the notice can span several + * lines and is only terminated by the closing star and slash: + */ + +/** + * Utility functions for the foo package. + * @license Apache-2.0 + */ + +// @lic + +/** + * Duplicate comment in same file. + * @license MIT + */ + + +/** + * Information. + * @license MIT + */ +", + "one.js": "/*! For license information please see licenses.txt */ +(()=>{var e,r,t={900:(e,r,t)=>{t.e(627).then(t.t.bind(t,627,7)),e.exports=Math.random()}},o={};function n(e){if(o[e])return o[e].exports;var r=o[e]={exports:{}};return t[e](r,r.exports,n),r.exports}n.m=t,n.t=function(e,r){if(1&r&&(e=this(e)),8&r)return e;if(4&r&&\\"object\\"==typeof e&&e&&e.__esModule)return e;var t=Object.create(null);n.r(t);var o={};if(2&r&&\\"object\\"==typeof e&&e)for(const r in e)o[r]=()=>e[r];return o.default=()=>e,n.d(t,o),t},n.d=(e,r)=>{for(var t in r)n.o(r,t)&&!n.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:r[t]})},n.f={},n.e=e=>Promise.all(Object.keys(n.f).reduce((r,t)=>(n.f[t](e,r),r),[])),n.u=e=>e+\\".\\"+e+\\".js\\",n.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),e={},r=\\"terser-webpack-plugin:\\",n.l=(t,o,a)=>{if(e[t])e[t].push(o);else{var i,u;if(void 0!==a)for(var l=document.getElementsByTagName(\\"script\\"),s=0;s{i.onerror=i.onload=null,clearTimeout(c);var n=e[t];if(delete e[t],i.parentNode&&i.parentNode.removeChild(i),n&&n.forEach(e=>e(o)),r)return r(o)},c=setTimeout(d.bind(null,void 0,{type:\\"timeout\\",target:i}),12e4);i.onerror=d.bind(null,i.onerror),i.onload=d.bind(null,i.onload),u&&document.head.appendChild(i)}},n.r=e=>{\\"undefined\\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:\\"Module\\"}),Object.defineProperty(e,\\"__esModule\\",{value:!0})},n.p=\\"\\",(()=>{var e={255:0};n.f.j=(r,t)=>{var o=n.o(e,r)?e[r]:void 0;if(0!==o)if(o)t.push(o[2]);else{var a=new Promise((t,n)=>{o=e[r]=[t,n]});t.push(o[2]=a);var i=n.p+n.u(r),u=new Error;n.l(i,t=>{if(n.o(e,r)&&(0!==(o=e[r])&&(e[r]=void 0),o)){var a=t&&(\\"load\\"===t.type?\\"missing\\":t.type),i=t&&t.target&&t.target.src;u.message=\\"Loading chunk \\"+r+\\" failed.\\\\n(\\"+a+\\": \\"+i+\\")\\",u.name=\\"ChunkLoadError\\",u.type=a,u.request=i,o[1](u)}},\\"chunk-\\"+r)}};var r=self.webpackChunkterser_webpack_plugin=self.webpackChunkterser_webpack_plugin||[],t=r.push.bind(r);r.push=r=>{for(var o,a,[i,u,l]=r,s=0,p=[];s{var r={787:r=>{r.exports=Math.random()}},t={};!function e(o){if(t[o])return t[o].exports;var n=t[o]={exports:{}};return r[o](n,n.exports,e),n.exports}(787)})();", + "two.js": "/*! For license information please see licenses.txt */ +(()=>{var r={353:r=>{r.exports=Math.random()}},t={};!function e(o){if(t[o])return t[o].exports;var n=t[o]={exports:{}};return r[o](n,n.exports,e),n.exports}(353)})();", +} +`; + +exports[`TerserPlugin should work, extract comments in one file and use memory cache memory cache when the "cache" option is "true" and the asset has been changed: assets 2`] = ` +Object { + "627.627.js": "/*! For license information please see licenses.txt */ +(self.webpackChunkterser_webpack_plugin=self.webpackChunkterser_webpack_plugin||[]).push([[627],{627:e=>{e.exports=Math.random()}}]);", + "four.js": "/*! For license information please see licenses.txt */ +(()=>{var r={712:r=>{r.exports=Math.random()}},t={};!function e(o){if(t[o])return t[o].exports;var n=t[o]={exports:{}};return r[o](n,n.exports,e),n.exports}(712)})();", + "licenses.txt": "/*! Legal Comment */ + +/** @license Copyright 2112 Moon. **/ + + +/** + * Duplicate comment in difference files. + * @license MIT + */ + + +/*! Legal Foo */ + +/** + * @preserve Copyright 2009 SomeThirdParty. + * Here is the full license text and copyright + * notice for this file. Note that the notice can span several + * lines and is only terminated by the closing star and slash: + */ + +/** + * Utility functions for the foo package. + * @license Apache-2.0 + */ + +// @lic + +/** + * Duplicate comment in same file. + * @license MIT + */ + + +/*! CHANGED */ + +/** + * Information. + * @license MIT + */ +", + "one.js": "/*! For license information please see licenses.txt */ +(()=>{var e,r,t={900:(e,r,t)=>{t.e(627).then(t.t.bind(t,627,7)),e.exports=Math.random()}},o={};function n(e){if(o[e])return o[e].exports;var r=o[e]={exports:{}};return t[e](r,r.exports,n),r.exports}n.m=t,n.t=function(e,r){if(1&r&&(e=this(e)),8&r)return e;if(4&r&&\\"object\\"==typeof e&&e&&e.__esModule)return e;var t=Object.create(null);n.r(t);var o={};if(2&r&&\\"object\\"==typeof e&&e)for(const r in e)o[r]=()=>e[r];return o.default=()=>e,n.d(t,o),t},n.d=(e,r)=>{for(var t in r)n.o(r,t)&&!n.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:r[t]})},n.f={},n.e=e=>Promise.all(Object.keys(n.f).reduce((r,t)=>(n.f[t](e,r),r),[])),n.u=e=>e+\\".\\"+e+\\".js\\",n.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),e={},r=\\"terser-webpack-plugin:\\",n.l=(t,o,a)=>{if(e[t])e[t].push(o);else{var i,u;if(void 0!==a)for(var l=document.getElementsByTagName(\\"script\\"),s=0;s{i.onerror=i.onload=null,clearTimeout(c);var n=e[t];if(delete e[t],i.parentNode&&i.parentNode.removeChild(i),n&&n.forEach(e=>e(o)),r)return r(o)},c=setTimeout(d.bind(null,void 0,{type:\\"timeout\\",target:i}),12e4);i.onerror=d.bind(null,i.onerror),i.onload=d.bind(null,i.onload),u&&document.head.appendChild(i)}},n.r=e=>{\\"undefined\\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:\\"Module\\"}),Object.defineProperty(e,\\"__esModule\\",{value:!0})},n.p=\\"\\",(()=>{var e={255:0};n.f.j=(r,t)=>{var o=n.o(e,r)?e[r]:void 0;if(0!==o)if(o)t.push(o[2]);else{var a=new Promise((t,n)=>{o=e[r]=[t,n]});t.push(o[2]=a);var i=n.p+n.u(r),u=new Error;n.l(i,t=>{if(n.o(e,r)&&(0!==(o=e[r])&&(e[r]=void 0),o)){var a=t&&(\\"load\\"===t.type?\\"missing\\":t.type),i=t&&t.target&&t.target.src;u.message=\\"Loading chunk \\"+r+\\" failed.\\\\n(\\"+a+\\": \\"+i+\\")\\",u.name=\\"ChunkLoadError\\",u.type=a,u.request=i,o[1](u)}},\\"chunk-\\"+r)}};var r=self.webpackChunkterser_webpack_plugin=self.webpackChunkterser_webpack_plugin||[],t=r.push.bind(r);r.push=r=>{for(var o,a,[i,u,l]=r,s=0,p=[];s{var r={787:r=>{r.exports=Math.random()}},t={};!function e(o){if(t[o])return t[o].exports;var n=t[o]={exports:{}};return r[o](n,n.exports,e),n.exports}(787)})();", + "two.js": "/*! For license information please see licenses.txt */ +function changed(){}(()=>{var r={353:r=>{r.exports=Math.random()}},t={};!function e(n){if(t[n])return t[n].exports;var o=t[n]={exports:{}};return r[n](o,o.exports,e),o.exports}(353)})();", +} +`; + +exports[`TerserPlugin should work, extract comments in one file and use memory cache memory cache when the "cache" option is "true" and the asset has been changed: errors 1`] = `Array []`; + +exports[`TerserPlugin should work, extract comments in one file and use memory cache memory cache when the "cache" option is "true" and the asset has been changed: errors 2`] = `Array []`; + +exports[`TerserPlugin should work, extract comments in one file and use memory cache memory cache when the "cache" option is "true" and the asset has been changed: warnings 1`] = `Array []`; + +exports[`TerserPlugin should work, extract comments in one file and use memory cache memory cache when the "cache" option is "true" and the asset has been changed: warnings 2`] = `Array []`; + +exports[`TerserPlugin should work, extract comments in one file and use memory cache memory cache when the "cache" option is "true": assets 1`] = ` +Object { + "627.627.js": "/*! For license information please see licenses.txt */ +(self.webpackChunkterser_webpack_plugin=self.webpackChunkterser_webpack_plugin||[]).push([[627],{627:e=>{e.exports=Math.random()}}]);", + "four.js": "/*! For license information please see licenses.txt */ +(()=>{var r={712:r=>{r.exports=Math.random()}},t={};!function e(o){if(t[o])return t[o].exports;var n=t[o]={exports:{}};return r[o](n,n.exports,e),n.exports}(712)})();", + "licenses.txt": "/*! Legal Comment */ + +/** @license Copyright 2112 Moon. **/ + + +/** + * Duplicate comment in difference files. + * @license MIT + */ + + +/*! Legal Foo */ + +/** + * @preserve Copyright 2009 SomeThirdParty. + * Here is the full license text and copyright + * notice for this file. Note that the notice can span several + * lines and is only terminated by the closing star and slash: + */ + +/** + * Utility functions for the foo package. + * @license Apache-2.0 + */ + +// @lic + +/** + * Duplicate comment in same file. + * @license MIT + */ + + +/** + * Information. + * @license MIT + */ +", + "one.js": "/*! For license information please see licenses.txt */ +(()=>{var e,r,t={900:(e,r,t)=>{t.e(627).then(t.t.bind(t,627,7)),e.exports=Math.random()}},o={};function n(e){if(o[e])return o[e].exports;var r=o[e]={exports:{}};return t[e](r,r.exports,n),r.exports}n.m=t,n.t=function(e,r){if(1&r&&(e=this(e)),8&r)return e;if(4&r&&\\"object\\"==typeof e&&e&&e.__esModule)return e;var t=Object.create(null);n.r(t);var o={};if(2&r&&\\"object\\"==typeof e&&e)for(const r in e)o[r]=()=>e[r];return o.default=()=>e,n.d(t,o),t},n.d=(e,r)=>{for(var t in r)n.o(r,t)&&!n.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:r[t]})},n.f={},n.e=e=>Promise.all(Object.keys(n.f).reduce((r,t)=>(n.f[t](e,r),r),[])),n.u=e=>e+\\".\\"+e+\\".js\\",n.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),e={},r=\\"terser-webpack-plugin:\\",n.l=(t,o,a)=>{if(e[t])e[t].push(o);else{var i,u;if(void 0!==a)for(var l=document.getElementsByTagName(\\"script\\"),s=0;s{i.onerror=i.onload=null,clearTimeout(c);var n=e[t];if(delete e[t],i.parentNode&&i.parentNode.removeChild(i),n&&n.forEach(e=>e(o)),r)return r(o)},c=setTimeout(d.bind(null,void 0,{type:\\"timeout\\",target:i}),12e4);i.onerror=d.bind(null,i.onerror),i.onload=d.bind(null,i.onload),u&&document.head.appendChild(i)}},n.r=e=>{\\"undefined\\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:\\"Module\\"}),Object.defineProperty(e,\\"__esModule\\",{value:!0})},n.p=\\"\\",(()=>{var e={255:0};n.f.j=(r,t)=>{var o=n.o(e,r)?e[r]:void 0;if(0!==o)if(o)t.push(o[2]);else{var a=new Promise((t,n)=>{o=e[r]=[t,n]});t.push(o[2]=a);var i=n.p+n.u(r),u=new Error;n.l(i,t=>{if(n.o(e,r)&&(0!==(o=e[r])&&(e[r]=void 0),o)){var a=t&&(\\"load\\"===t.type?\\"missing\\":t.type),i=t&&t.target&&t.target.src;u.message=\\"Loading chunk \\"+r+\\" failed.\\\\n(\\"+a+\\": \\"+i+\\")\\",u.name=\\"ChunkLoadError\\",u.type=a,u.request=i,o[1](u)}},\\"chunk-\\"+r)}};var r=self.webpackChunkterser_webpack_plugin=self.webpackChunkterser_webpack_plugin||[],t=r.push.bind(r);r.push=r=>{for(var o,a,[i,u,l]=r,s=0,p=[];s{var r={787:r=>{r.exports=Math.random()}},t={};!function e(o){if(t[o])return t[o].exports;var n=t[o]={exports:{}};return r[o](n,n.exports,e),n.exports}(787)})();", + "two.js": "/*! For license information please see licenses.txt */ +(()=>{var r={353:r=>{r.exports=Math.random()}},t={};!function e(o){if(t[o])return t[o].exports;var n=t[o]={exports:{}};return r[o](n,n.exports,e),n.exports}(353)})();", +} +`; + +exports[`TerserPlugin should work, extract comments in one file and use memory cache memory cache when the "cache" option is "true": assets 2`] = ` +Object { + "627.627.js": "/*! For license information please see licenses.txt */ +(self.webpackChunkterser_webpack_plugin=self.webpackChunkterser_webpack_plugin||[]).push([[627],{627:e=>{e.exports=Math.random()}}]);", + "four.js": "/*! For license information please see licenses.txt */ +(()=>{var r={712:r=>{r.exports=Math.random()}},t={};!function e(o){if(t[o])return t[o].exports;var n=t[o]={exports:{}};return r[o](n,n.exports,e),n.exports}(712)})();", + "licenses.txt": "/*! Legal Comment */ + +/** @license Copyright 2112 Moon. **/ + + +/** + * Duplicate comment in difference files. + * @license MIT + */ + + +/*! Legal Foo */ + +/** + * @preserve Copyright 2009 SomeThirdParty. + * Here is the full license text and copyright + * notice for this file. Note that the notice can span several + * lines and is only terminated by the closing star and slash: + */ + +/** + * Utility functions for the foo package. + * @license Apache-2.0 + */ + +// @lic + +/** + * Duplicate comment in same file. + * @license MIT + */ + + +/** + * Information. + * @license MIT + */ +", + "one.js": "/*! For license information please see licenses.txt */ +(()=>{var e,r,t={900:(e,r,t)=>{t.e(627).then(t.t.bind(t,627,7)),e.exports=Math.random()}},o={};function n(e){if(o[e])return o[e].exports;var r=o[e]={exports:{}};return t[e](r,r.exports,n),r.exports}n.m=t,n.t=function(e,r){if(1&r&&(e=this(e)),8&r)return e;if(4&r&&\\"object\\"==typeof e&&e&&e.__esModule)return e;var t=Object.create(null);n.r(t);var o={};if(2&r&&\\"object\\"==typeof e&&e)for(const r in e)o[r]=()=>e[r];return o.default=()=>e,n.d(t,o),t},n.d=(e,r)=>{for(var t in r)n.o(r,t)&&!n.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:r[t]})},n.f={},n.e=e=>Promise.all(Object.keys(n.f).reduce((r,t)=>(n.f[t](e,r),r),[])),n.u=e=>e+\\".\\"+e+\\".js\\",n.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),e={},r=\\"terser-webpack-plugin:\\",n.l=(t,o,a)=>{if(e[t])e[t].push(o);else{var i,u;if(void 0!==a)for(var l=document.getElementsByTagName(\\"script\\"),s=0;s{i.onerror=i.onload=null,clearTimeout(c);var n=e[t];if(delete e[t],i.parentNode&&i.parentNode.removeChild(i),n&&n.forEach(e=>e(o)),r)return r(o)},c=setTimeout(d.bind(null,void 0,{type:\\"timeout\\",target:i}),12e4);i.onerror=d.bind(null,i.onerror),i.onload=d.bind(null,i.onload),u&&document.head.appendChild(i)}},n.r=e=>{\\"undefined\\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:\\"Module\\"}),Object.defineProperty(e,\\"__esModule\\",{value:!0})},n.p=\\"\\",(()=>{var e={255:0};n.f.j=(r,t)=>{var o=n.o(e,r)?e[r]:void 0;if(0!==o)if(o)t.push(o[2]);else{var a=new Promise((t,n)=>{o=e[r]=[t,n]});t.push(o[2]=a);var i=n.p+n.u(r),u=new Error;n.l(i,t=>{if(n.o(e,r)&&(0!==(o=e[r])&&(e[r]=void 0),o)){var a=t&&(\\"load\\"===t.type?\\"missing\\":t.type),i=t&&t.target&&t.target.src;u.message=\\"Loading chunk \\"+r+\\" failed.\\\\n(\\"+a+\\": \\"+i+\\")\\",u.name=\\"ChunkLoadError\\",u.type=a,u.request=i,o[1](u)}},\\"chunk-\\"+r)}};var r=self.webpackChunkterser_webpack_plugin=self.webpackChunkterser_webpack_plugin||[],t=r.push.bind(r);r.push=r=>{for(var o,a,[i,u,l]=r,s=0,p=[];s{var r={787:r=>{r.exports=Math.random()}},t={};!function e(o){if(t[o])return t[o].exports;var n=t[o]={exports:{}};return r[o](n,n.exports,e),n.exports}(787)})();", + "two.js": "/*! For license information please see licenses.txt */ +(()=>{var r={353:r=>{r.exports=Math.random()}},t={};!function e(o){if(t[o])return t[o].exports;var n=t[o]={exports:{}};return r[o](n,n.exports,e),n.exports}(353)})();", +} +`; + +exports[`TerserPlugin should work, extract comments in one file and use memory cache memory cache when the "cache" option is "true": errors 1`] = `Array []`; + +exports[`TerserPlugin should work, extract comments in one file and use memory cache memory cache when the "cache" option is "true": errors 2`] = `Array []`; + +exports[`TerserPlugin should work, extract comments in one file and use memory cache memory cache when the "cache" option is "true": warnings 1`] = `Array []`; + +exports[`TerserPlugin should work, extract comments in one file and use memory cache memory cache when the "cache" option is "true": warnings 2`] = `Array []`; + exports[`TerserPlugin should write stdout and stderr of workers to stdout and stderr of main process in not parallel mode: assets 1`] = ` Object { "one.js": "", diff --git a/test/__snapshots__/cache-option.test.js.snap.webpack4 b/test/__snapshots__/cache-option.test.js.snap.webpack4 index 4295b7b9..e429e7ea 100644 --- a/test/__snapshots__/cache-option.test.js.snap.webpack4 +++ b/test/__snapshots__/cache-option.test.js.snap.webpack4 @@ -70,6 +70,280 @@ exports[`"cache" option should match snapshot for the "other-cache-directory" va exports[`"cache" option should match snapshot for the "other-cache-directory" value: warnings 2`] = `Array []`; +exports[`"cache" option should match snapshot for the "true" value and extract comments in different files: assets 1`] = ` +Object { + "4.4.js": "/*! For license information please see 4.4.js.LICENSE.txt */ +(window.webpackJsonp=window.webpackJsonp||[]).push([[4],{4:function(n,o){n.exports=Math.random()}}]);", + "4.4.js.LICENSE.txt": "/*! Legal Comment */ + +/** @license Copyright 2112 Moon. **/ +", + "four.js": "/*! For license information please see four.js.LICENSE.txt */ +!function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){\\"undefined\\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:\\"Module\\"}),Object.defineProperty(e,\\"__esModule\\",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&\\"object\\"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,\\"default\\",{enumerable:!0,value:e}),2&t&&\\"string\\"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,\\"a\\",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p=\\"\\",r(r.s=3)}({3:function(e,t){e.exports=Math.random()}});", + "four.js.LICENSE.txt": "/** + * Duplicate comment in difference files. + * @license MIT + */ +", + "one.js": "/*! For license information please see one.js.LICENSE.txt */ +!function(e){function t(t){for(var r,o,u=t[0],i=t[1],a=0,l=[];a/test/}}); +//# sourceMappingURL=three.js.map", + "three.js.map": "{\\"version\\":3,\\"sources\\":[\\"webpack:///webpack/bootstrap\\",\\"webpack:///./test/fixtures/cache-2.js\\"],\\"names\\":[\\"installedModules\\",\\"__webpack_require__\\",\\"moduleId\\",\\"exports\\",\\"module\\",\\"i\\",\\"l\\",\\"modules\\",\\"call\\",\\"m\\",\\"c\\",\\"d\\",\\"name\\",\\"getter\\",\\"o\\",\\"Object\\",\\"defineProperty\\",\\"enumerable\\",\\"get\\",\\"r\\",\\"Symbol\\",\\"toStringTag\\",\\"value\\",\\"t\\",\\"mode\\",\\"__esModule\\",\\"ns\\",\\"create\\",\\"key\\",\\"bind\\",\\"n\\",\\"object\\",\\"property\\",\\"prototype\\",\\"hasOwnProperty\\",\\"p\\",\\"s\\"],\\"mappings\\":\\"aACE,IAAIA,EAAmB,GAGvB,SAASC,EAAoBC,GAG5B,GAAGF,EAAiBE,GACnB,OAAOF,EAAiBE,GAAUC,QAGnC,IAAIC,EAASJ,EAAiBE,GAAY,CACzCG,EAAGH,EACHI,GAAG,EACHH,QAAS,IAUV,OANAI,EAAQL,GAAUM,KAAKJ,EAAOD,QAASC,EAAQA,EAAOD,QAASF,GAG/DG,EAAOE,GAAI,EAGJF,EAAOD,QAKfF,EAAoBQ,EAAIF,EAGxBN,EAAoBS,EAAIV,EAGxBC,EAAoBU,EAAI,SAASR,EAASS,EAAMC,GAC3CZ,EAAoBa,EAAEX,EAASS,IAClCG,OAAOC,eAAeb,EAASS,EAAM,CAAEK,YAAY,EAAMC,IAAKL,KAKhEZ,EAAoBkB,EAAI,SAAShB,GACX,oBAAXiB,QAA0BA,OAAOC,aAC1CN,OAAOC,eAAeb,EAASiB,OAAOC,YAAa,CAAEC,MAAO,WAE7DP,OAAOC,eAAeb,EAAS,aAAc,CAAEmB,OAAO,KAQvDrB,EAAoBsB,EAAI,SAASD,EAAOE,GAEvC,GADU,EAAPA,IAAUF,EAAQrB,EAAoBqB,IAC/B,EAAPE,EAAU,OAAOF,EACpB,GAAW,EAAPE,GAA8B,iBAAVF,GAAsBA,GAASA,EAAMG,WAAY,OAAOH,EAChF,IAAII,EAAKX,OAAOY,OAAO,MAGvB,GAFA1B,EAAoBkB,EAAEO,GACtBX,OAAOC,eAAeU,EAAI,UAAW,CAAET,YAAY,EAAMK,MAAOA,IACtD,EAAPE,GAA4B,iBAATF,EAAmB,IAAI,IAAIM,KAAON,EAAOrB,EAAoBU,EAAEe,EAAIE,EAAK,SAASA,GAAO,OAAON,EAAMM,IAAQC,KAAK,KAAMD,IAC9I,OAAOF,GAIRzB,EAAoB6B,EAAI,SAAS1B,GAChC,IAAIS,EAAST,GAAUA,EAAOqB,WAC7B,WAAwB,OAAOrB,EAAgB,SAC/C,WAA8B,OAAOA,GAEtC,OADAH,EAAoBU,EAAEE,EAAQ,IAAKA,GAC5BA,GAIRZ,EAAoBa,EAAI,SAASiB,EAAQC,GAAY,OAAOjB,OAAOkB,UAAUC,eAAe1B,KAAKuB,EAAQC,IAGzG/B,EAAoBkC,EAAI,GAIjBlC,EAAoBA,EAAoBmC,EAAI,G,kBClFrDhC,EAAOD,QAAU,IAAe\\",\\"file\\":\\"three.js\\",\\"sourcesContent\\":[\\" \\\\t// The module cache\\\\n \\\\tvar installedModules = {};\\\\n\\\\n \\\\t// The require function\\\\n \\\\tfunction __webpack_require__(moduleId) {\\\\n\\\\n \\\\t\\\\t// Check if module is in cache\\\\n \\\\t\\\\tif(installedModules[moduleId]) {\\\\n \\\\t\\\\t\\\\treturn installedModules[moduleId].exports;\\\\n \\\\t\\\\t}\\\\n \\\\t\\\\t// Create a new module (and put it into the cache)\\\\n \\\\t\\\\tvar module = installedModules[moduleId] = {\\\\n \\\\t\\\\t\\\\ti: moduleId,\\\\n \\\\t\\\\t\\\\tl: false,\\\\n \\\\t\\\\t\\\\texports: {}\\\\n \\\\t\\\\t};\\\\n\\\\n \\\\t\\\\t// Execute the module function\\\\n \\\\t\\\\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\\\\n\\\\n \\\\t\\\\t// Flag the module as loaded\\\\n \\\\t\\\\tmodule.l = true;\\\\n\\\\n \\\\t\\\\t// Return the exports of the module\\\\n \\\\t\\\\treturn module.exports;\\\\n \\\\t}\\\\n\\\\n\\\\n \\\\t// expose the modules object (__webpack_modules__)\\\\n \\\\t__webpack_require__.m = modules;\\\\n\\\\n \\\\t// expose the module cache\\\\n \\\\t__webpack_require__.c = installedModules;\\\\n\\\\n \\\\t// define getter function for harmony exports\\\\n \\\\t__webpack_require__.d = function(exports, name, getter) {\\\\n \\\\t\\\\tif(!__webpack_require__.o(exports, name)) {\\\\n \\\\t\\\\t\\\\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\\\\n \\\\t\\\\t}\\\\n \\\\t};\\\\n\\\\n \\\\t// define __esModule on exports\\\\n \\\\t__webpack_require__.r = function(exports) {\\\\n \\\\t\\\\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\\\\n \\\\t\\\\t\\\\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\\\\n \\\\t\\\\t}\\\\n \\\\t\\\\tObject.defineProperty(exports, '__esModule', { value: true });\\\\n \\\\t};\\\\n\\\\n \\\\t// create a fake namespace object\\\\n \\\\t// mode & 1: value is a module id, require it\\\\n \\\\t// mode & 2: merge all properties of value into the ns\\\\n \\\\t// mode & 4: return value when already ns object\\\\n \\\\t// mode & 8|1: behave like require\\\\n \\\\t__webpack_require__.t = function(value, mode) {\\\\n \\\\t\\\\tif(mode & 1) value = __webpack_require__(value);\\\\n \\\\t\\\\tif(mode & 8) return value;\\\\n \\\\t\\\\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\\\\n \\\\t\\\\tvar ns = Object.create(null);\\\\n \\\\t\\\\t__webpack_require__.r(ns);\\\\n \\\\t\\\\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\\\\n \\\\t\\\\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\\\\n \\\\t\\\\treturn ns;\\\\n \\\\t};\\\\n\\\\n \\\\t// getDefaultExport function for compatibility with non-harmony modules\\\\n \\\\t__webpack_require__.n = function(module) {\\\\n \\\\t\\\\tvar getter = module && module.__esModule ?\\\\n \\\\t\\\\t\\\\tfunction getDefault() { return module['default']; } :\\\\n \\\\t\\\\t\\\\tfunction getModuleExports() { return module; };\\\\n \\\\t\\\\t__webpack_require__.d(getter, 'a', getter);\\\\n \\\\t\\\\treturn getter;\\\\n \\\\t};\\\\n\\\\n \\\\t// Object.prototype.hasOwnProperty.call\\\\n \\\\t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\\\\n\\\\n \\\\t// __webpack_public_path__\\\\n \\\\t__webpack_require__.p = \\\\\\"\\\\\\";\\\\n\\\\n\\\\n \\\\t// Load entry module and return exports\\\\n \\\\treturn __webpack_require__(__webpack_require__.s = 2);\\\\n\\",\\"module.exports = () => { return /test/ };\\\\n\\"],\\"sourceRoot\\":\\"\\"}", + "two.js": "!function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){\\"undefined\\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:\\"Module\\"}),Object.defineProperty(e,\\"__esModule\\",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&\\"object\\"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,\\"default\\",{enumerable:!0,value:e}),2&t&&\\"string\\"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,\\"a\\",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p=\\"\\",r(r.s=1)}([,function(e,t){e.exports=\\"string\\"}]); +//# sourceMappingURL=two.js.map", + "two.js.map": "{\\"version\\":3,\\"sources\\":[\\"webpack:///webpack/bootstrap\\",\\"webpack:///./test/fixtures/cache-1.js\\"],\\"names\\":[\\"installedModules\\",\\"__webpack_require__\\",\\"moduleId\\",\\"exports\\",\\"module\\",\\"i\\",\\"l\\",\\"modules\\",\\"call\\",\\"m\\",\\"c\\",\\"d\\",\\"name\\",\\"getter\\",\\"o\\",\\"Object\\",\\"defineProperty\\",\\"enumerable\\",\\"get\\",\\"r\\",\\"Symbol\\",\\"toStringTag\\",\\"value\\",\\"t\\",\\"mode\\",\\"__esModule\\",\\"ns\\",\\"create\\",\\"key\\",\\"bind\\",\\"n\\",\\"object\\",\\"property\\",\\"prototype\\",\\"hasOwnProperty\\",\\"p\\",\\"s\\"],\\"mappings\\":\\"aACE,IAAIA,EAAmB,GAGvB,SAASC,EAAoBC,GAG5B,GAAGF,EAAiBE,GACnB,OAAOF,EAAiBE,GAAUC,QAGnC,IAAIC,EAASJ,EAAiBE,GAAY,CACzCG,EAAGH,EACHI,GAAG,EACHH,QAAS,IAUV,OANAI,EAAQL,GAAUM,KAAKJ,EAAOD,QAASC,EAAQA,EAAOD,QAASF,GAG/DG,EAAOE,GAAI,EAGJF,EAAOD,QAKfF,EAAoBQ,EAAIF,EAGxBN,EAAoBS,EAAIV,EAGxBC,EAAoBU,EAAI,SAASR,EAASS,EAAMC,GAC3CZ,EAAoBa,EAAEX,EAASS,IAClCG,OAAOC,eAAeb,EAASS,EAAM,CAAEK,YAAY,EAAMC,IAAKL,KAKhEZ,EAAoBkB,EAAI,SAAShB,GACX,oBAAXiB,QAA0BA,OAAOC,aAC1CN,OAAOC,eAAeb,EAASiB,OAAOC,YAAa,CAAEC,MAAO,WAE7DP,OAAOC,eAAeb,EAAS,aAAc,CAAEmB,OAAO,KAQvDrB,EAAoBsB,EAAI,SAASD,EAAOE,GAEvC,GADU,EAAPA,IAAUF,EAAQrB,EAAoBqB,IAC/B,EAAPE,EAAU,OAAOF,EACpB,GAAW,EAAPE,GAA8B,iBAAVF,GAAsBA,GAASA,EAAMG,WAAY,OAAOH,EAChF,IAAII,EAAKX,OAAOY,OAAO,MAGvB,GAFA1B,EAAoBkB,EAAEO,GACtBX,OAAOC,eAAeU,EAAI,UAAW,CAAET,YAAY,EAAMK,MAAOA,IACtD,EAAPE,GAA4B,iBAATF,EAAmB,IAAI,IAAIM,KAAON,EAAOrB,EAAoBU,EAAEe,EAAIE,EAAK,SAASA,GAAO,OAAON,EAAMM,IAAQC,KAAK,KAAMD,IAC9I,OAAOF,GAIRzB,EAAoB6B,EAAI,SAAS1B,GAChC,IAAIS,EAAST,GAAUA,EAAOqB,WAC7B,WAAwB,OAAOrB,EAAgB,SAC/C,WAA8B,OAAOA,GAEtC,OADAH,EAAoBU,EAAEE,EAAQ,IAAKA,GAC5BA,GAIRZ,EAAoBa,EAAI,SAASiB,EAAQC,GAAY,OAAOjB,OAAOkB,UAAUC,eAAe1B,KAAKuB,EAAQC,IAGzG/B,EAAoBkC,EAAI,GAIjBlC,EAAoBA,EAAoBmC,EAAI,G,iBClFrDhC,EAAOD,QAAU\\",\\"file\\":\\"two.js\\",\\"sourcesContent\\":[\\" \\\\t// The module cache\\\\n \\\\tvar installedModules = {};\\\\n\\\\n \\\\t// The require function\\\\n \\\\tfunction __webpack_require__(moduleId) {\\\\n\\\\n \\\\t\\\\t// Check if module is in cache\\\\n \\\\t\\\\tif(installedModules[moduleId]) {\\\\n \\\\t\\\\t\\\\treturn installedModules[moduleId].exports;\\\\n \\\\t\\\\t}\\\\n \\\\t\\\\t// Create a new module (and put it into the cache)\\\\n \\\\t\\\\tvar module = installedModules[moduleId] = {\\\\n \\\\t\\\\t\\\\ti: moduleId,\\\\n \\\\t\\\\t\\\\tl: false,\\\\n \\\\t\\\\t\\\\texports: {}\\\\n \\\\t\\\\t};\\\\n\\\\n \\\\t\\\\t// Execute the module function\\\\n \\\\t\\\\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\\\\n\\\\n \\\\t\\\\t// Flag the module as loaded\\\\n \\\\t\\\\tmodule.l = true;\\\\n\\\\n \\\\t\\\\t// Return the exports of the module\\\\n \\\\t\\\\treturn module.exports;\\\\n \\\\t}\\\\n\\\\n\\\\n \\\\t// expose the modules object (__webpack_modules__)\\\\n \\\\t__webpack_require__.m = modules;\\\\n\\\\n \\\\t// expose the module cache\\\\n \\\\t__webpack_require__.c = installedModules;\\\\n\\\\n \\\\t// define getter function for harmony exports\\\\n \\\\t__webpack_require__.d = function(exports, name, getter) {\\\\n \\\\t\\\\tif(!__webpack_require__.o(exports, name)) {\\\\n \\\\t\\\\t\\\\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\\\\n \\\\t\\\\t}\\\\n \\\\t};\\\\n\\\\n \\\\t// define __esModule on exports\\\\n \\\\t__webpack_require__.r = function(exports) {\\\\n \\\\t\\\\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\\\\n \\\\t\\\\t\\\\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\\\\n \\\\t\\\\t}\\\\n \\\\t\\\\tObject.defineProperty(exports, '__esModule', { value: true });\\\\n \\\\t};\\\\n\\\\n \\\\t// create a fake namespace object\\\\n \\\\t// mode & 1: value is a module id, require it\\\\n \\\\t// mode & 2: merge all properties of value into the ns\\\\n \\\\t// mode & 4: return value when already ns object\\\\n \\\\t// mode & 8|1: behave like require\\\\n \\\\t__webpack_require__.t = function(value, mode) {\\\\n \\\\t\\\\tif(mode & 1) value = __webpack_require__(value);\\\\n \\\\t\\\\tif(mode & 8) return value;\\\\n \\\\t\\\\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\\\\n \\\\t\\\\tvar ns = Object.create(null);\\\\n \\\\t\\\\t__webpack_require__.r(ns);\\\\n \\\\t\\\\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\\\\n \\\\t\\\\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\\\\n \\\\t\\\\treturn ns;\\\\n \\\\t};\\\\n\\\\n \\\\t// getDefaultExport function for compatibility with non-harmony modules\\\\n \\\\t__webpack_require__.n = function(module) {\\\\n \\\\t\\\\tvar getter = module && module.__esModule ?\\\\n \\\\t\\\\t\\\\tfunction getDefault() { return module['default']; } :\\\\n \\\\t\\\\t\\\\tfunction getModuleExports() { return module; };\\\\n \\\\t\\\\t__webpack_require__.d(getter, 'a', getter);\\\\n \\\\t\\\\treturn getter;\\\\n \\\\t};\\\\n\\\\n \\\\t// Object.prototype.hasOwnProperty.call\\\\n \\\\t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\\\\n\\\\n \\\\t// __webpack_public_path__\\\\n \\\\t__webpack_require__.p = \\\\\\"\\\\\\";\\\\n\\\\n\\\\n \\\\t// Load entry module and return exports\\\\n \\\\treturn __webpack_require__(__webpack_require__.s = 1);\\\\n\\",\\"module.exports = 'string';\\\\n\\"],\\"sourceRoot\\":\\"\\"}", +} +`; + +exports[`"cache" option should match snapshot for the "true" value and source maps: assets 2`] = ` +Object { + "five.js": "!function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){\\"undefined\\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:\\"Module\\"}),Object.defineProperty(e,\\"__esModule\\",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&\\"object\\"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,\\"default\\",{enumerable:!0,value:e}),2&t&&\\"string\\"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,\\"a\\",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p=\\"\\",n(n.s=4)}({4:function(e,t){e.exports=function(){console.log(7)}}}); +//# sourceMappingURL=five.js.map", + "five.js.map": "{\\"version\\":3,\\"sources\\":[\\"webpack:///webpack/bootstrap\\",\\"webpack:///./test/fixtures/cache-4.js\\"],\\"names\\":[\\"installedModules\\",\\"__webpack_require__\\",\\"moduleId\\",\\"exports\\",\\"module\\",\\"i\\",\\"l\\",\\"modules\\",\\"call\\",\\"m\\",\\"c\\",\\"d\\",\\"name\\",\\"getter\\",\\"o\\",\\"Object\\",\\"defineProperty\\",\\"enumerable\\",\\"get\\",\\"r\\",\\"Symbol\\",\\"toStringTag\\",\\"value\\",\\"t\\",\\"mode\\",\\"__esModule\\",\\"ns\\",\\"create\\",\\"key\\",\\"bind\\",\\"n\\",\\"object\\",\\"property\\",\\"prototype\\",\\"hasOwnProperty\\",\\"p\\",\\"s\\",\\"console\\",\\"log\\",\\"b\\"],\\"mappings\\":\\"aACE,IAAIA,EAAmB,GAGvB,SAASC,EAAoBC,GAG5B,GAAGF,EAAiBE,GACnB,OAAOF,EAAiBE,GAAUC,QAGnC,IAAIC,EAASJ,EAAiBE,GAAY,CACzCG,EAAGH,EACHI,GAAG,EACHH,QAAS,IAUV,OANAI,EAAQL,GAAUM,KAAKJ,EAAOD,QAASC,EAAQA,EAAOD,QAASF,GAG/DG,EAAOE,GAAI,EAGJF,EAAOD,QAKfF,EAAoBQ,EAAIF,EAGxBN,EAAoBS,EAAIV,EAGxBC,EAAoBU,EAAI,SAASR,EAASS,EAAMC,GAC3CZ,EAAoBa,EAAEX,EAASS,IAClCG,OAAOC,eAAeb,EAASS,EAAM,CAAEK,YAAY,EAAMC,IAAKL,KAKhEZ,EAAoBkB,EAAI,SAAShB,GACX,oBAAXiB,QAA0BA,OAAOC,aAC1CN,OAAOC,eAAeb,EAASiB,OAAOC,YAAa,CAAEC,MAAO,WAE7DP,OAAOC,eAAeb,EAAS,aAAc,CAAEmB,OAAO,KAQvDrB,EAAoBsB,EAAI,SAASD,EAAOE,GAEvC,GADU,EAAPA,IAAUF,EAAQrB,EAAoBqB,IAC/B,EAAPE,EAAU,OAAOF,EACpB,GAAW,EAAPE,GAA8B,iBAAVF,GAAsBA,GAASA,EAAMG,WAAY,OAAOH,EAChF,IAAII,EAAKX,OAAOY,OAAO,MAGvB,GAFA1B,EAAoBkB,EAAEO,GACtBX,OAAOC,eAAeU,EAAI,UAAW,CAAET,YAAY,EAAMK,MAAOA,IACtD,EAAPE,GAA4B,iBAATF,EAAmB,IAAI,IAAIM,KAAON,EAAOrB,EAAoBU,EAAEe,EAAIE,EAAK,SAASA,GAAO,OAAON,EAAMM,IAAQC,KAAK,KAAMD,IAC9I,OAAOF,GAIRzB,EAAoB6B,EAAI,SAAS1B,GAChC,IAAIS,EAAST,GAAUA,EAAOqB,WAC7B,WAAwB,OAAOrB,EAAgB,SAC/C,WAA8B,OAAOA,GAEtC,OADAH,EAAoBU,EAAEE,EAAQ,IAAKA,GAC5BA,GAIRZ,EAAoBa,EAAI,SAASiB,EAAQC,GAAY,OAAOjB,OAAOkB,UAAUC,eAAe1B,KAAKuB,EAAQC,IAGzG/B,EAAoBkC,EAAI,GAIjBlC,EAAoBA,EAAoBmC,EAAI,G,kBC7ErDhC,EAAOD,QAAU,WAEfkC,QAAQC,IAAIC\\",\\"file\\":\\"five.js\\",\\"sourcesContent\\":[\\" \\\\t// The module cache\\\\n \\\\tvar installedModules = {};\\\\n\\\\n \\\\t// The require function\\\\n \\\\tfunction __webpack_require__(moduleId) {\\\\n\\\\n \\\\t\\\\t// Check if module is in cache\\\\n \\\\t\\\\tif(installedModules[moduleId]) {\\\\n \\\\t\\\\t\\\\treturn installedModules[moduleId].exports;\\\\n \\\\t\\\\t}\\\\n \\\\t\\\\t// Create a new module (and put it into the cache)\\\\n \\\\t\\\\tvar module = installedModules[moduleId] = {\\\\n \\\\t\\\\t\\\\ti: moduleId,\\\\n \\\\t\\\\t\\\\tl: false,\\\\n \\\\t\\\\t\\\\texports: {}\\\\n \\\\t\\\\t};\\\\n\\\\n \\\\t\\\\t// Execute the module function\\\\n \\\\t\\\\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\\\\n\\\\n \\\\t\\\\t// Flag the module as loaded\\\\n \\\\t\\\\tmodule.l = true;\\\\n\\\\n \\\\t\\\\t// Return the exports of the module\\\\n \\\\t\\\\treturn module.exports;\\\\n \\\\t}\\\\n\\\\n\\\\n \\\\t// expose the modules object (__webpack_modules__)\\\\n \\\\t__webpack_require__.m = modules;\\\\n\\\\n \\\\t// expose the module cache\\\\n \\\\t__webpack_require__.c = installedModules;\\\\n\\\\n \\\\t// define getter function for harmony exports\\\\n \\\\t__webpack_require__.d = function(exports, name, getter) {\\\\n \\\\t\\\\tif(!__webpack_require__.o(exports, name)) {\\\\n \\\\t\\\\t\\\\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\\\\n \\\\t\\\\t}\\\\n \\\\t};\\\\n\\\\n \\\\t// define __esModule on exports\\\\n \\\\t__webpack_require__.r = function(exports) {\\\\n \\\\t\\\\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\\\\n \\\\t\\\\t\\\\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\\\\n \\\\t\\\\t}\\\\n \\\\t\\\\tObject.defineProperty(exports, '__esModule', { value: true });\\\\n \\\\t};\\\\n\\\\n \\\\t// create a fake namespace object\\\\n \\\\t// mode & 1: value is a module id, require it\\\\n \\\\t// mode & 2: merge all properties of value into the ns\\\\n \\\\t// mode & 4: return value when already ns object\\\\n \\\\t// mode & 8|1: behave like require\\\\n \\\\t__webpack_require__.t = function(value, mode) {\\\\n \\\\t\\\\tif(mode & 1) value = __webpack_require__(value);\\\\n \\\\t\\\\tif(mode & 8) return value;\\\\n \\\\t\\\\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\\\\n \\\\t\\\\tvar ns = Object.create(null);\\\\n \\\\t\\\\t__webpack_require__.r(ns);\\\\n \\\\t\\\\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\\\\n \\\\t\\\\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\\\\n \\\\t\\\\treturn ns;\\\\n \\\\t};\\\\n\\\\n \\\\t// getDefaultExport function for compatibility with non-harmony modules\\\\n \\\\t__webpack_require__.n = function(module) {\\\\n \\\\t\\\\tvar getter = module && module.__esModule ?\\\\n \\\\t\\\\t\\\\tfunction getDefault() { return module['default']; } :\\\\n \\\\t\\\\t\\\\tfunction getModuleExports() { return module; };\\\\n \\\\t\\\\t__webpack_require__.d(getter, 'a', getter);\\\\n \\\\t\\\\treturn getter;\\\\n \\\\t};\\\\n\\\\n \\\\t// Object.prototype.hasOwnProperty.call\\\\n \\\\t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\\\\n\\\\n \\\\t// __webpack_public_path__\\\\n \\\\t__webpack_require__.p = \\\\\\"\\\\\\";\\\\n\\\\n\\\\n \\\\t// Load entry module and return exports\\\\n \\\\treturn __webpack_require__(__webpack_require__.s = 4);\\\\n\\",\\"// foo\\\\n/* @preserve*/\\\\n// bar\\\\nconst a = 2 + 2;\\\\n\\\\nmodule.exports = function Foo() {\\\\n const b = 2 + 2;\\\\n console.log(b + 1 + 2);\\\\n};\\\\n\\"],\\"sourceRoot\\":\\"\\"}", + "four.js": "!function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){\\"undefined\\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:\\"Module\\"}),Object.defineProperty(e,\\"__esModule\\",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&\\"object\\"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,\\"default\\",{enumerable:!0,value:e}),2&t&&\\"string\\"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,\\"a\\",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p=\\"\\",r(r.s=3)}({3:function(e,t){e.exports=class{}}}); +//# sourceMappingURL=four.js.map", + "four.js.map": "{\\"version\\":3,\\"sources\\":[\\"webpack:///webpack/bootstrap\\",\\"webpack:///./test/fixtures/cache-3.js\\"],\\"names\\":[\\"installedModules\\",\\"__webpack_require__\\",\\"moduleId\\",\\"exports\\",\\"module\\",\\"i\\",\\"l\\",\\"modules\\",\\"call\\",\\"m\\",\\"c\\",\\"d\\",\\"name\\",\\"getter\\",\\"o\\",\\"Object\\",\\"defineProperty\\",\\"enumerable\\",\\"get\\",\\"r\\",\\"Symbol\\",\\"toStringTag\\",\\"value\\",\\"t\\",\\"mode\\",\\"__esModule\\",\\"ns\\",\\"create\\",\\"key\\",\\"bind\\",\\"n\\",\\"object\\",\\"property\\",\\"prototype\\",\\"hasOwnProperty\\",\\"p\\",\\"s\\"],\\"mappings\\":\\"aACE,IAAIA,EAAmB,GAGvB,SAASC,EAAoBC,GAG5B,GAAGF,EAAiBE,GACnB,OAAOF,EAAiBE,GAAUC,QAGnC,IAAIC,EAASJ,EAAiBE,GAAY,CACzCG,EAAGH,EACHI,GAAG,EACHH,QAAS,IAUV,OANAI,EAAQL,GAAUM,KAAKJ,EAAOD,QAASC,EAAQA,EAAOD,QAASF,GAG/DG,EAAOE,GAAI,EAGJF,EAAOD,QAKfF,EAAoBQ,EAAIF,EAGxBN,EAAoBS,EAAIV,EAGxBC,EAAoBU,EAAI,SAASR,EAASS,EAAMC,GAC3CZ,EAAoBa,EAAEX,EAASS,IAClCG,OAAOC,eAAeb,EAASS,EAAM,CAAEK,YAAY,EAAMC,IAAKL,KAKhEZ,EAAoBkB,EAAI,SAAShB,GACX,oBAAXiB,QAA0BA,OAAOC,aAC1CN,OAAOC,eAAeb,EAASiB,OAAOC,YAAa,CAAEC,MAAO,WAE7DP,OAAOC,eAAeb,EAAS,aAAc,CAAEmB,OAAO,KAQvDrB,EAAoBsB,EAAI,SAASD,EAAOE,GAEvC,GADU,EAAPA,IAAUF,EAAQrB,EAAoBqB,IAC/B,EAAPE,EAAU,OAAOF,EACpB,GAAW,EAAPE,GAA8B,iBAAVF,GAAsBA,GAASA,EAAMG,WAAY,OAAOH,EAChF,IAAII,EAAKX,OAAOY,OAAO,MAGvB,GAFA1B,EAAoBkB,EAAEO,GACtBX,OAAOC,eAAeU,EAAI,UAAW,CAAET,YAAY,EAAMK,MAAOA,IACtD,EAAPE,GAA4B,iBAATF,EAAmB,IAAI,IAAIM,KAAON,EAAOrB,EAAoBU,EAAEe,EAAIE,EAAK,SAASA,GAAO,OAAON,EAAMM,IAAQC,KAAK,KAAMD,IAC9I,OAAOF,GAIRzB,EAAoB6B,EAAI,SAAS1B,GAChC,IAAIS,EAAST,GAAUA,EAAOqB,WAC7B,WAAwB,OAAOrB,EAAgB,SAC/C,WAA8B,OAAOA,GAEtC,OADAH,EAAoBU,EAAEE,EAAQ,IAAKA,GAC5BA,GAIRZ,EAAoBa,EAAI,SAASiB,EAAQC,GAAY,OAAOjB,OAAOkB,UAAUC,eAAe1B,KAAKuB,EAAQC,IAGzG/B,EAAoBkC,EAAI,GAIjBlC,EAAoBA,EAAoBmC,EAAI,G,kBClFrDhC,EAAOD,QAAU\\",\\"file\\":\\"four.js\\",\\"sourcesContent\\":[\\" \\\\t// The module cache\\\\n \\\\tvar installedModules = {};\\\\n\\\\n \\\\t// The require function\\\\n \\\\tfunction __webpack_require__(moduleId) {\\\\n\\\\n \\\\t\\\\t// Check if module is in cache\\\\n \\\\t\\\\tif(installedModules[moduleId]) {\\\\n \\\\t\\\\t\\\\treturn installedModules[moduleId].exports;\\\\n \\\\t\\\\t}\\\\n \\\\t\\\\t// Create a new module (and put it into the cache)\\\\n \\\\t\\\\tvar module = installedModules[moduleId] = {\\\\n \\\\t\\\\t\\\\ti: moduleId,\\\\n \\\\t\\\\t\\\\tl: false,\\\\n \\\\t\\\\t\\\\texports: {}\\\\n \\\\t\\\\t};\\\\n\\\\n \\\\t\\\\t// Execute the module function\\\\n \\\\t\\\\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\\\\n\\\\n \\\\t\\\\t// Flag the module as loaded\\\\n \\\\t\\\\tmodule.l = true;\\\\n\\\\n \\\\t\\\\t// Return the exports of the module\\\\n \\\\t\\\\treturn module.exports;\\\\n \\\\t}\\\\n\\\\n\\\\n \\\\t// expose the modules object (__webpack_modules__)\\\\n \\\\t__webpack_require__.m = modules;\\\\n\\\\n \\\\t// expose the module cache\\\\n \\\\t__webpack_require__.c = installedModules;\\\\n\\\\n \\\\t// define getter function for harmony exports\\\\n \\\\t__webpack_require__.d = function(exports, name, getter) {\\\\n \\\\t\\\\tif(!__webpack_require__.o(exports, name)) {\\\\n \\\\t\\\\t\\\\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\\\\n \\\\t\\\\t}\\\\n \\\\t};\\\\n\\\\n \\\\t// define __esModule on exports\\\\n \\\\t__webpack_require__.r = function(exports) {\\\\n \\\\t\\\\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\\\\n \\\\t\\\\t\\\\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\\\\n \\\\t\\\\t}\\\\n \\\\t\\\\tObject.defineProperty(exports, '__esModule', { value: true });\\\\n \\\\t};\\\\n\\\\n \\\\t// create a fake namespace object\\\\n \\\\t// mode & 1: value is a module id, require it\\\\n \\\\t// mode & 2: merge all properties of value into the ns\\\\n \\\\t// mode & 4: return value when already ns object\\\\n \\\\t// mode & 8|1: behave like require\\\\n \\\\t__webpack_require__.t = function(value, mode) {\\\\n \\\\t\\\\tif(mode & 1) value = __webpack_require__(value);\\\\n \\\\t\\\\tif(mode & 8) return value;\\\\n \\\\t\\\\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\\\\n \\\\t\\\\tvar ns = Object.create(null);\\\\n \\\\t\\\\t__webpack_require__.r(ns);\\\\n \\\\t\\\\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\\\\n \\\\t\\\\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\\\\n \\\\t\\\\treturn ns;\\\\n \\\\t};\\\\n\\\\n \\\\t// getDefaultExport function for compatibility with non-harmony modules\\\\n \\\\t__webpack_require__.n = function(module) {\\\\n \\\\t\\\\tvar getter = module && module.__esModule ?\\\\n \\\\t\\\\t\\\\tfunction getDefault() { return module['default']; } :\\\\n \\\\t\\\\t\\\\tfunction getModuleExports() { return module; };\\\\n \\\\t\\\\t__webpack_require__.d(getter, 'a', getter);\\\\n \\\\t\\\\treturn getter;\\\\n \\\\t};\\\\n\\\\n \\\\t// Object.prototype.hasOwnProperty.call\\\\n \\\\t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\\\\n\\\\n \\\\t// __webpack_public_path__\\\\n \\\\t__webpack_require__.p = \\\\\\"\\\\\\";\\\\n\\\\n\\\\n \\\\t// Load entry module and return exports\\\\n \\\\treturn __webpack_require__(__webpack_require__.s = 3);\\\\n\\",\\"module.exports = class A {};\\\\n\\"],\\"sourceRoot\\":\\"\\"}", + "one.js": "!function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){\\"undefined\\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:\\"Module\\"}),Object.defineProperty(e,\\"__esModule\\",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&\\"object\\"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,\\"default\\",{enumerable:!0,value:e}),2&t&&\\"string\\"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,\\"a\\",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p=\\"\\",n(n.s=0)}([function(e,t){e.exports=function(){console.log(7)}}]); +//# sourceMappingURL=one.js.map", + "one.js.map": "{\\"version\\":3,\\"sources\\":[\\"webpack:///webpack/bootstrap\\",\\"webpack:///./test/fixtures/cache.js\\"],\\"names\\":[\\"installedModules\\",\\"__webpack_require__\\",\\"moduleId\\",\\"exports\\",\\"module\\",\\"i\\",\\"l\\",\\"modules\\",\\"call\\",\\"m\\",\\"c\\",\\"d\\",\\"name\\",\\"getter\\",\\"o\\",\\"Object\\",\\"defineProperty\\",\\"enumerable\\",\\"get\\",\\"r\\",\\"Symbol\\",\\"toStringTag\\",\\"value\\",\\"t\\",\\"mode\\",\\"__esModule\\",\\"ns\\",\\"create\\",\\"key\\",\\"bind\\",\\"n\\",\\"object\\",\\"property\\",\\"prototype\\",\\"hasOwnProperty\\",\\"p\\",\\"s\\",\\"console\\",\\"log\\",\\"b\\"],\\"mappings\\":\\"aACE,IAAIA,EAAmB,GAGvB,SAASC,EAAoBC,GAG5B,GAAGF,EAAiBE,GACnB,OAAOF,EAAiBE,GAAUC,QAGnC,IAAIC,EAASJ,EAAiBE,GAAY,CACzCG,EAAGH,EACHI,GAAG,EACHH,QAAS,IAUV,OANAI,EAAQL,GAAUM,KAAKJ,EAAOD,QAASC,EAAQA,EAAOD,QAASF,GAG/DG,EAAOE,GAAI,EAGJF,EAAOD,QAKfF,EAAoBQ,EAAIF,EAGxBN,EAAoBS,EAAIV,EAGxBC,EAAoBU,EAAI,SAASR,EAASS,EAAMC,GAC3CZ,EAAoBa,EAAEX,EAASS,IAClCG,OAAOC,eAAeb,EAASS,EAAM,CAAEK,YAAY,EAAMC,IAAKL,KAKhEZ,EAAoBkB,EAAI,SAAShB,GACX,oBAAXiB,QAA0BA,OAAOC,aAC1CN,OAAOC,eAAeb,EAASiB,OAAOC,YAAa,CAAEC,MAAO,WAE7DP,OAAOC,eAAeb,EAAS,aAAc,CAAEmB,OAAO,KAQvDrB,EAAoBsB,EAAI,SAASD,EAAOE,GAEvC,GADU,EAAPA,IAAUF,EAAQrB,EAAoBqB,IAC/B,EAAPE,EAAU,OAAOF,EACpB,GAAW,EAAPE,GAA8B,iBAAVF,GAAsBA,GAASA,EAAMG,WAAY,OAAOH,EAChF,IAAII,EAAKX,OAAOY,OAAO,MAGvB,GAFA1B,EAAoBkB,EAAEO,GACtBX,OAAOC,eAAeU,EAAI,UAAW,CAAET,YAAY,EAAMK,MAAOA,IACtD,EAAPE,GAA4B,iBAATF,EAAmB,IAAI,IAAIM,KAAON,EAAOrB,EAAoBU,EAAEe,EAAIE,EAAK,SAASA,GAAO,OAAON,EAAMM,IAAQC,KAAK,KAAMD,IAC9I,OAAOF,GAIRzB,EAAoB6B,EAAI,SAAS1B,GAChC,IAAIS,EAAST,GAAUA,EAAOqB,WAC7B,WAAwB,OAAOrB,EAAgB,SAC/C,WAA8B,OAAOA,GAEtC,OADAH,EAAoBU,EAAEE,EAAQ,IAAKA,GAC5BA,GAIRZ,EAAoBa,EAAI,SAASiB,EAAQC,GAAY,OAAOjB,OAAOkB,UAAUC,eAAe1B,KAAKuB,EAAQC,IAGzG/B,EAAoBkC,EAAI,GAIjBlC,EAAoBA,EAAoBmC,EAAI,G,gBC7ErDhC,EAAOD,QAAU,WAEfkC,QAAQC,IAAIC\\",\\"file\\":\\"one.js\\",\\"sourcesContent\\":[\\" \\\\t// The module cache\\\\n \\\\tvar installedModules = {};\\\\n\\\\n \\\\t// The require function\\\\n \\\\tfunction __webpack_require__(moduleId) {\\\\n\\\\n \\\\t\\\\t// Check if module is in cache\\\\n \\\\t\\\\tif(installedModules[moduleId]) {\\\\n \\\\t\\\\t\\\\treturn installedModules[moduleId].exports;\\\\n \\\\t\\\\t}\\\\n \\\\t\\\\t// Create a new module (and put it into the cache)\\\\n \\\\t\\\\tvar module = installedModules[moduleId] = {\\\\n \\\\t\\\\t\\\\ti: moduleId,\\\\n \\\\t\\\\t\\\\tl: false,\\\\n \\\\t\\\\t\\\\texports: {}\\\\n \\\\t\\\\t};\\\\n\\\\n \\\\t\\\\t// Execute the module function\\\\n \\\\t\\\\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\\\\n\\\\n \\\\t\\\\t// Flag the module as loaded\\\\n \\\\t\\\\tmodule.l = true;\\\\n\\\\n \\\\t\\\\t// Return the exports of the module\\\\n \\\\t\\\\treturn module.exports;\\\\n \\\\t}\\\\n\\\\n\\\\n \\\\t// expose the modules object (__webpack_modules__)\\\\n \\\\t__webpack_require__.m = modules;\\\\n\\\\n \\\\t// expose the module cache\\\\n \\\\t__webpack_require__.c = installedModules;\\\\n\\\\n \\\\t// define getter function for harmony exports\\\\n \\\\t__webpack_require__.d = function(exports, name, getter) {\\\\n \\\\t\\\\tif(!__webpack_require__.o(exports, name)) {\\\\n \\\\t\\\\t\\\\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\\\\n \\\\t\\\\t}\\\\n \\\\t};\\\\n\\\\n \\\\t// define __esModule on exports\\\\n \\\\t__webpack_require__.r = function(exports) {\\\\n \\\\t\\\\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\\\\n \\\\t\\\\t\\\\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\\\\n \\\\t\\\\t}\\\\n \\\\t\\\\tObject.defineProperty(exports, '__esModule', { value: true });\\\\n \\\\t};\\\\n\\\\n \\\\t// create a fake namespace object\\\\n \\\\t// mode & 1: value is a module id, require it\\\\n \\\\t// mode & 2: merge all properties of value into the ns\\\\n \\\\t// mode & 4: return value when already ns object\\\\n \\\\t// mode & 8|1: behave like require\\\\n \\\\t__webpack_require__.t = function(value, mode) {\\\\n \\\\t\\\\tif(mode & 1) value = __webpack_require__(value);\\\\n \\\\t\\\\tif(mode & 8) return value;\\\\n \\\\t\\\\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\\\\n \\\\t\\\\tvar ns = Object.create(null);\\\\n \\\\t\\\\t__webpack_require__.r(ns);\\\\n \\\\t\\\\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\\\\n \\\\t\\\\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\\\\n \\\\t\\\\treturn ns;\\\\n \\\\t};\\\\n\\\\n \\\\t// getDefaultExport function for compatibility with non-harmony modules\\\\n \\\\t__webpack_require__.n = function(module) {\\\\n \\\\t\\\\tvar getter = module && module.__esModule ?\\\\n \\\\t\\\\t\\\\tfunction getDefault() { return module['default']; } :\\\\n \\\\t\\\\t\\\\tfunction getModuleExports() { return module; };\\\\n \\\\t\\\\t__webpack_require__.d(getter, 'a', getter);\\\\n \\\\t\\\\treturn getter;\\\\n \\\\t};\\\\n\\\\n \\\\t// Object.prototype.hasOwnProperty.call\\\\n \\\\t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\\\\n\\\\n \\\\t// __webpack_public_path__\\\\n \\\\t__webpack_require__.p = \\\\\\"\\\\\\";\\\\n\\\\n\\\\n \\\\t// Load entry module and return exports\\\\n \\\\treturn __webpack_require__(__webpack_require__.s = 0);\\\\n\\",\\"// foo\\\\n/* @preserve*/\\\\n// bar\\\\nconst a = 2 + 2;\\\\n\\\\nmodule.exports = function Foo() {\\\\n const b = 2 + 2;\\\\n console.log(b + 1 + 2);\\\\n};\\\\n\\"],\\"sourceRoot\\":\\"\\"}", + "three.js": "!function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){\\"undefined\\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:\\"Module\\"}),Object.defineProperty(e,\\"__esModule\\",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&\\"object\\"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,\\"default\\",{enumerable:!0,value:e}),2&t&&\\"string\\"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,\\"a\\",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p=\\"\\",r(r.s=2)}({2:function(e,t){e.exports=()=>/test/}}); +//# sourceMappingURL=three.js.map", + "three.js.map": "{\\"version\\":3,\\"sources\\":[\\"webpack:///webpack/bootstrap\\",\\"webpack:///./test/fixtures/cache-2.js\\"],\\"names\\":[\\"installedModules\\",\\"__webpack_require__\\",\\"moduleId\\",\\"exports\\",\\"module\\",\\"i\\",\\"l\\",\\"modules\\",\\"call\\",\\"m\\",\\"c\\",\\"d\\",\\"name\\",\\"getter\\",\\"o\\",\\"Object\\",\\"defineProperty\\",\\"enumerable\\",\\"get\\",\\"r\\",\\"Symbol\\",\\"toStringTag\\",\\"value\\",\\"t\\",\\"mode\\",\\"__esModule\\",\\"ns\\",\\"create\\",\\"key\\",\\"bind\\",\\"n\\",\\"object\\",\\"property\\",\\"prototype\\",\\"hasOwnProperty\\",\\"p\\",\\"s\\"],\\"mappings\\":\\"aACE,IAAIA,EAAmB,GAGvB,SAASC,EAAoBC,GAG5B,GAAGF,EAAiBE,GACnB,OAAOF,EAAiBE,GAAUC,QAGnC,IAAIC,EAASJ,EAAiBE,GAAY,CACzCG,EAAGH,EACHI,GAAG,EACHH,QAAS,IAUV,OANAI,EAAQL,GAAUM,KAAKJ,EAAOD,QAASC,EAAQA,EAAOD,QAASF,GAG/DG,EAAOE,GAAI,EAGJF,EAAOD,QAKfF,EAAoBQ,EAAIF,EAGxBN,EAAoBS,EAAIV,EAGxBC,EAAoBU,EAAI,SAASR,EAASS,EAAMC,GAC3CZ,EAAoBa,EAAEX,EAASS,IAClCG,OAAOC,eAAeb,EAASS,EAAM,CAAEK,YAAY,EAAMC,IAAKL,KAKhEZ,EAAoBkB,EAAI,SAAShB,GACX,oBAAXiB,QAA0BA,OAAOC,aAC1CN,OAAOC,eAAeb,EAASiB,OAAOC,YAAa,CAAEC,MAAO,WAE7DP,OAAOC,eAAeb,EAAS,aAAc,CAAEmB,OAAO,KAQvDrB,EAAoBsB,EAAI,SAASD,EAAOE,GAEvC,GADU,EAAPA,IAAUF,EAAQrB,EAAoBqB,IAC/B,EAAPE,EAAU,OAAOF,EACpB,GAAW,EAAPE,GAA8B,iBAAVF,GAAsBA,GAASA,EAAMG,WAAY,OAAOH,EAChF,IAAII,EAAKX,OAAOY,OAAO,MAGvB,GAFA1B,EAAoBkB,EAAEO,GACtBX,OAAOC,eAAeU,EAAI,UAAW,CAAET,YAAY,EAAMK,MAAOA,IACtD,EAAPE,GAA4B,iBAATF,EAAmB,IAAI,IAAIM,KAAON,EAAOrB,EAAoBU,EAAEe,EAAIE,EAAK,SAASA,GAAO,OAAON,EAAMM,IAAQC,KAAK,KAAMD,IAC9I,OAAOF,GAIRzB,EAAoB6B,EAAI,SAAS1B,GAChC,IAAIS,EAAST,GAAUA,EAAOqB,WAC7B,WAAwB,OAAOrB,EAAgB,SAC/C,WAA8B,OAAOA,GAEtC,OADAH,EAAoBU,EAAEE,EAAQ,IAAKA,GAC5BA,GAIRZ,EAAoBa,EAAI,SAASiB,EAAQC,GAAY,OAAOjB,OAAOkB,UAAUC,eAAe1B,KAAKuB,EAAQC,IAGzG/B,EAAoBkC,EAAI,GAIjBlC,EAAoBA,EAAoBmC,EAAI,G,kBClFrDhC,EAAOD,QAAU,IAAe\\",\\"file\\":\\"three.js\\",\\"sourcesContent\\":[\\" \\\\t// The module cache\\\\n \\\\tvar installedModules = {};\\\\n\\\\n \\\\t// The require function\\\\n \\\\tfunction __webpack_require__(moduleId) {\\\\n\\\\n \\\\t\\\\t// Check if module is in cache\\\\n \\\\t\\\\tif(installedModules[moduleId]) {\\\\n \\\\t\\\\t\\\\treturn installedModules[moduleId].exports;\\\\n \\\\t\\\\t}\\\\n \\\\t\\\\t// Create a new module (and put it into the cache)\\\\n \\\\t\\\\tvar module = installedModules[moduleId] = {\\\\n \\\\t\\\\t\\\\ti: moduleId,\\\\n \\\\t\\\\t\\\\tl: false,\\\\n \\\\t\\\\t\\\\texports: {}\\\\n \\\\t\\\\t};\\\\n\\\\n \\\\t\\\\t// Execute the module function\\\\n \\\\t\\\\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\\\\n\\\\n \\\\t\\\\t// Flag the module as loaded\\\\n \\\\t\\\\tmodule.l = true;\\\\n\\\\n \\\\t\\\\t// Return the exports of the module\\\\n \\\\t\\\\treturn module.exports;\\\\n \\\\t}\\\\n\\\\n\\\\n \\\\t// expose the modules object (__webpack_modules__)\\\\n \\\\t__webpack_require__.m = modules;\\\\n\\\\n \\\\t// expose the module cache\\\\n \\\\t__webpack_require__.c = installedModules;\\\\n\\\\n \\\\t// define getter function for harmony exports\\\\n \\\\t__webpack_require__.d = function(exports, name, getter) {\\\\n \\\\t\\\\tif(!__webpack_require__.o(exports, name)) {\\\\n \\\\t\\\\t\\\\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\\\\n \\\\t\\\\t}\\\\n \\\\t};\\\\n\\\\n \\\\t// define __esModule on exports\\\\n \\\\t__webpack_require__.r = function(exports) {\\\\n \\\\t\\\\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\\\\n \\\\t\\\\t\\\\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\\\\n \\\\t\\\\t}\\\\n \\\\t\\\\tObject.defineProperty(exports, '__esModule', { value: true });\\\\n \\\\t};\\\\n\\\\n \\\\t// create a fake namespace object\\\\n \\\\t// mode & 1: value is a module id, require it\\\\n \\\\t// mode & 2: merge all properties of value into the ns\\\\n \\\\t// mode & 4: return value when already ns object\\\\n \\\\t// mode & 8|1: behave like require\\\\n \\\\t__webpack_require__.t = function(value, mode) {\\\\n \\\\t\\\\tif(mode & 1) value = __webpack_require__(value);\\\\n \\\\t\\\\tif(mode & 8) return value;\\\\n \\\\t\\\\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\\\\n \\\\t\\\\tvar ns = Object.create(null);\\\\n \\\\t\\\\t__webpack_require__.r(ns);\\\\n \\\\t\\\\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\\\\n \\\\t\\\\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\\\\n \\\\t\\\\treturn ns;\\\\n \\\\t};\\\\n\\\\n \\\\t// getDefaultExport function for compatibility with non-harmony modules\\\\n \\\\t__webpack_require__.n = function(module) {\\\\n \\\\t\\\\tvar getter = module && module.__esModule ?\\\\n \\\\t\\\\t\\\\tfunction getDefault() { return module['default']; } :\\\\n \\\\t\\\\t\\\\tfunction getModuleExports() { return module; };\\\\n \\\\t\\\\t__webpack_require__.d(getter, 'a', getter);\\\\n \\\\t\\\\treturn getter;\\\\n \\\\t};\\\\n\\\\n \\\\t// Object.prototype.hasOwnProperty.call\\\\n \\\\t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\\\\n\\\\n \\\\t// __webpack_public_path__\\\\n \\\\t__webpack_require__.p = \\\\\\"\\\\\\";\\\\n\\\\n\\\\n \\\\t// Load entry module and return exports\\\\n \\\\treturn __webpack_require__(__webpack_require__.s = 2);\\\\n\\",\\"module.exports = () => { return /test/ };\\\\n\\"],\\"sourceRoot\\":\\"\\"}", + "two.js": "!function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){\\"undefined\\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:\\"Module\\"}),Object.defineProperty(e,\\"__esModule\\",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&\\"object\\"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,\\"default\\",{enumerable:!0,value:e}),2&t&&\\"string\\"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,\\"a\\",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p=\\"\\",r(r.s=1)}([,function(e,t){e.exports=\\"string\\"}]); +//# sourceMappingURL=two.js.map", + "two.js.map": "{\\"version\\":3,\\"sources\\":[\\"webpack:///webpack/bootstrap\\",\\"webpack:///./test/fixtures/cache-1.js\\"],\\"names\\":[\\"installedModules\\",\\"__webpack_require__\\",\\"moduleId\\",\\"exports\\",\\"module\\",\\"i\\",\\"l\\",\\"modules\\",\\"call\\",\\"m\\",\\"c\\",\\"d\\",\\"name\\",\\"getter\\",\\"o\\",\\"Object\\",\\"defineProperty\\",\\"enumerable\\",\\"get\\",\\"r\\",\\"Symbol\\",\\"toStringTag\\",\\"value\\",\\"t\\",\\"mode\\",\\"__esModule\\",\\"ns\\",\\"create\\",\\"key\\",\\"bind\\",\\"n\\",\\"object\\",\\"property\\",\\"prototype\\",\\"hasOwnProperty\\",\\"p\\",\\"s\\"],\\"mappings\\":\\"aACE,IAAIA,EAAmB,GAGvB,SAASC,EAAoBC,GAG5B,GAAGF,EAAiBE,GACnB,OAAOF,EAAiBE,GAAUC,QAGnC,IAAIC,EAASJ,EAAiBE,GAAY,CACzCG,EAAGH,EACHI,GAAG,EACHH,QAAS,IAUV,OANAI,EAAQL,GAAUM,KAAKJ,EAAOD,QAASC,EAAQA,EAAOD,QAASF,GAG/DG,EAAOE,GAAI,EAGJF,EAAOD,QAKfF,EAAoBQ,EAAIF,EAGxBN,EAAoBS,EAAIV,EAGxBC,EAAoBU,EAAI,SAASR,EAASS,EAAMC,GAC3CZ,EAAoBa,EAAEX,EAASS,IAClCG,OAAOC,eAAeb,EAASS,EAAM,CAAEK,YAAY,EAAMC,IAAKL,KAKhEZ,EAAoBkB,EAAI,SAAShB,GACX,oBAAXiB,QAA0BA,OAAOC,aAC1CN,OAAOC,eAAeb,EAASiB,OAAOC,YAAa,CAAEC,MAAO,WAE7DP,OAAOC,eAAeb,EAAS,aAAc,CAAEmB,OAAO,KAQvDrB,EAAoBsB,EAAI,SAASD,EAAOE,GAEvC,GADU,EAAPA,IAAUF,EAAQrB,EAAoBqB,IAC/B,EAAPE,EAAU,OAAOF,EACpB,GAAW,EAAPE,GAA8B,iBAAVF,GAAsBA,GAASA,EAAMG,WAAY,OAAOH,EAChF,IAAII,EAAKX,OAAOY,OAAO,MAGvB,GAFA1B,EAAoBkB,EAAEO,GACtBX,OAAOC,eAAeU,EAAI,UAAW,CAAET,YAAY,EAAMK,MAAOA,IACtD,EAAPE,GAA4B,iBAATF,EAAmB,IAAI,IAAIM,KAAON,EAAOrB,EAAoBU,EAAEe,EAAIE,EAAK,SAASA,GAAO,OAAON,EAAMM,IAAQC,KAAK,KAAMD,IAC9I,OAAOF,GAIRzB,EAAoB6B,EAAI,SAAS1B,GAChC,IAAIS,EAAST,GAAUA,EAAOqB,WAC7B,WAAwB,OAAOrB,EAAgB,SAC/C,WAA8B,OAAOA,GAEtC,OADAH,EAAoBU,EAAEE,EAAQ,IAAKA,GAC5BA,GAIRZ,EAAoBa,EAAI,SAASiB,EAAQC,GAAY,OAAOjB,OAAOkB,UAAUC,eAAe1B,KAAKuB,EAAQC,IAGzG/B,EAAoBkC,EAAI,GAIjBlC,EAAoBA,EAAoBmC,EAAI,G,iBClFrDhC,EAAOD,QAAU\\",\\"file\\":\\"two.js\\",\\"sourcesContent\\":[\\" \\\\t// The module cache\\\\n \\\\tvar installedModules = {};\\\\n\\\\n \\\\t// The require function\\\\n \\\\tfunction __webpack_require__(moduleId) {\\\\n\\\\n \\\\t\\\\t// Check if module is in cache\\\\n \\\\t\\\\tif(installedModules[moduleId]) {\\\\n \\\\t\\\\t\\\\treturn installedModules[moduleId].exports;\\\\n \\\\t\\\\t}\\\\n \\\\t\\\\t// Create a new module (and put it into the cache)\\\\n \\\\t\\\\tvar module = installedModules[moduleId] = {\\\\n \\\\t\\\\t\\\\ti: moduleId,\\\\n \\\\t\\\\t\\\\tl: false,\\\\n \\\\t\\\\t\\\\texports: {}\\\\n \\\\t\\\\t};\\\\n\\\\n \\\\t\\\\t// Execute the module function\\\\n \\\\t\\\\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\\\\n\\\\n \\\\t\\\\t// Flag the module as loaded\\\\n \\\\t\\\\tmodule.l = true;\\\\n\\\\n \\\\t\\\\t// Return the exports of the module\\\\n \\\\t\\\\treturn module.exports;\\\\n \\\\t}\\\\n\\\\n\\\\n \\\\t// expose the modules object (__webpack_modules__)\\\\n \\\\t__webpack_require__.m = modules;\\\\n\\\\n \\\\t// expose the module cache\\\\n \\\\t__webpack_require__.c = installedModules;\\\\n\\\\n \\\\t// define getter function for harmony exports\\\\n \\\\t__webpack_require__.d = function(exports, name, getter) {\\\\n \\\\t\\\\tif(!__webpack_require__.o(exports, name)) {\\\\n \\\\t\\\\t\\\\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\\\\n \\\\t\\\\t}\\\\n \\\\t};\\\\n\\\\n \\\\t// define __esModule on exports\\\\n \\\\t__webpack_require__.r = function(exports) {\\\\n \\\\t\\\\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\\\\n \\\\t\\\\t\\\\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\\\\n \\\\t\\\\t}\\\\n \\\\t\\\\tObject.defineProperty(exports, '__esModule', { value: true });\\\\n \\\\t};\\\\n\\\\n \\\\t// create a fake namespace object\\\\n \\\\t// mode & 1: value is a module id, require it\\\\n \\\\t// mode & 2: merge all properties of value into the ns\\\\n \\\\t// mode & 4: return value when already ns object\\\\n \\\\t// mode & 8|1: behave like require\\\\n \\\\t__webpack_require__.t = function(value, mode) {\\\\n \\\\t\\\\tif(mode & 1) value = __webpack_require__(value);\\\\n \\\\t\\\\tif(mode & 8) return value;\\\\n \\\\t\\\\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\\\\n \\\\t\\\\tvar ns = Object.create(null);\\\\n \\\\t\\\\t__webpack_require__.r(ns);\\\\n \\\\t\\\\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\\\\n \\\\t\\\\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\\\\n \\\\t\\\\treturn ns;\\\\n \\\\t};\\\\n\\\\n \\\\t// getDefaultExport function for compatibility with non-harmony modules\\\\n \\\\t__webpack_require__.n = function(module) {\\\\n \\\\t\\\\tvar getter = module && module.__esModule ?\\\\n \\\\t\\\\t\\\\tfunction getDefault() { return module['default']; } :\\\\n \\\\t\\\\t\\\\tfunction getModuleExports() { return module; };\\\\n \\\\t\\\\t__webpack_require__.d(getter, 'a', getter);\\\\n \\\\t\\\\treturn getter;\\\\n \\\\t};\\\\n\\\\n \\\\t// Object.prototype.hasOwnProperty.call\\\\n \\\\t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\\\\n\\\\n \\\\t// __webpack_public_path__\\\\n \\\\t__webpack_require__.p = \\\\\\"\\\\\\";\\\\n\\\\n\\\\n \\\\t// Load entry module and return exports\\\\n \\\\treturn __webpack_require__(__webpack_require__.s = 1);\\\\n\\",\\"module.exports = 'string';\\\\n\\"],\\"sourceRoot\\":\\"\\"}", +} +`; + +exports[`"cache" option should match snapshot for the "true" value and source maps: errors 1`] = `Array []`; + +exports[`"cache" option should match snapshot for the "true" value and source maps: errors 2`] = `Array []`; + +exports[`"cache" option should match snapshot for the "true" value and source maps: warnings 1`] = `Array []`; + +exports[`"cache" option should match snapshot for the "true" value and source maps: warnings 2`] = `Array []`; + exports[`"cache" option should match snapshot for the "true" value: assets 1`] = ` Object { "five.js": "!function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){\\"undefined\\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:\\"Module\\"}),Object.defineProperty(e,\\"__esModule\\",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&\\"object\\"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,\\"default\\",{enumerable:!0,value:e}),2&t&&\\"string\\"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,\\"a\\",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p=\\"\\",n(n.s=4)}({4:function(e,t){e.exports=function(){console.log(7)}}});", diff --git a/test/__snapshots__/extractComments-option.test.js.snap.webpack4 b/test/__snapshots__/extractComments-option.test.js.snap.webpack4 index 071ba016..8f18e1cb 100644 --- a/test/__snapshots__/extractComments-option.test.js.snap.webpack4 +++ b/test/__snapshots__/extractComments-option.test.js.snap.webpack4 @@ -5447,6 +5447,9 @@ Object { !function(e){function t(t){for(var r,o,u=t[0],i=t[1],a=0,l=[];a{var e,r,t={900:(e,r,t)=>{t.e(627).then(t.t.bind(t,627,7)),e.exports=Math.random()}},o={};function n(e){if(o[e])return o[e].exports;var r=o[e]={exports:{}};return t[e](r,r.exports,n),r.exports}n.m=t,n.t=function(e,r){if(1&r&&(e=this(e)),8&r)return e;if(4&r&&\\"object\\"==typeof e&&e&&e.__esModule)return e;var t=Object.create(null);n.r(t);var o={};if(2&r&&\\"object\\"==typeof e&&e)for(const r in e)o[r]=()=>e[r];return o.default=()=>e,n.d(t,o),t},n.d=(e,r)=>{for(var t in r)n.o(r,t)&&!n.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:r[t]})},n.f={},n.e=e=>Promise.all(Object.keys(n.f).reduce((r,t)=>(n.f[t](e,r),r),[])),n.u=e=>\\"nested/directory/\\"+e+\\".js?9e5a02fb3f24a83d172c\\",n.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),e={},r=\\"terser-webpack-plugin:\\",n.l=(t,o,a)=>{if(e[t])e[t].push(o);else{var i,u;if(void 0!==a)for(var l=document.getElementsByTagName(\\"script\\"),d=0;d{i.onerror=i.onload=null,clearTimeout(c);var n=e[t];if(delete e[t],i.parentNode&&i.parentNode.removeChild(i),n&&n.forEach(e=>e(o)),r)return r(o)},c=setTimeout(p.bind(null,void 0,{type:\\"timeout\\",target:i}),12e4);i.onerror=p.bind(null,i.onerror),i.onload=p.bind(null,i.onload),u&&document.head.appendChild(i)}},n.r=e=>{\\"undefined\\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:\\"Module\\"}),Object.defineProperty(e,\\"__esModule\\",{value:!0})},n.p=\\"\\",(()=>{var e={255:0};n.f.j=(r,t)=>{var o=n.o(e,r)?e[r]:void 0;if(0!==o)if(o)t.push(o[2]);else{var a=new Promise((t,n)=>{o=e[r]=[t,n]});t.push(o[2]=a);var i=n.p+n.u(r),u=new Error;n.l(i,t=>{if(n.o(e,r)&&(0!==(o=e[r])&&(e[r]=void 0),o)){var a=t&&(\\"load\\"===t.type?\\"missing\\":t.type),i=t&&t.target&&t.target.src;u.message=\\"Loading chunk \\"+r+\\" failed.\\\\n(\\"+a+\\": \\"+i+\\")\\",u.name=\\"ChunkLoadError\\",u.type=a,u.request=i,o[1](u)}},\\"chunk-\\"+r)}};var r=self.webpackChunkterser_webpack_plugin=self.webpackChunkterser_webpack_plugin||[],t=r.push.bind(r);r.push=r=>{for(var o,a,[i,u,l]=r,d=0,s=[];d{e.exports=Math.random()}}]);", "comments/directory/one.js": "/*! Legal Comment */ +/** @license Copyright 2112 Moon. **/ + + /*! Legal Foo */ /** @@ -4309,8 +4313,6 @@ Object { * @license Apache-2.0 */ -/** @license Copyright 2112 Moon. **/ - // @lic ", "one.js": "/*! For license information please see comments/directory/one.js */ @@ -5093,6 +5095,15 @@ Object { (self.webpackChunkterser_webpack_plugin=self.webpackChunkterser_webpack_plugin||[]).push([[627],{627:e=>{e.exports=Math.random()}}]);", "extracted-comments.js": "/*! Legal Comment */ +/** @license Copyright 2112 Moon. **/ + + +/** + * Duplicate comment in difference files. + * @license MIT + */ + + /*! Legal Foo */ /** @@ -5103,28 +5114,22 @@ Object { */ /** - * Duplicate comment in difference files. - * @license MIT + * Utility functions for the foo package. + * @license Apache-2.0 */ +// @lic + /** * Duplicate comment in same file. * @license MIT */ + /** * Information. * @license MIT */ - -/** - * Utility functions for the foo package. - * @license Apache-2.0 - */ - -/** @license Copyright 2112 Moon. **/ - -// @lic ", "filename/four.js": "/*! License information can be found in extracted-comments.js */ (()=>{var r={712:r=>{r.exports=Math.random()}},t={};!function e(o){if(t[o])return t[o].exports;var n=t[o]={exports:{}};return r[o](n,n.exports,e),n.exports}(712)})();", @@ -5147,6 +5152,15 @@ Object { (self.webpackChunkterser_webpack_plugin=self.webpackChunkterser_webpack_plugin||[]).push([[627],{627:e=>{e.exports=Math.random()}}]);", "extracted-comments.js": "/*! Legal Comment */ +/** @license Copyright 2112 Moon. **/ + + +/** + * Duplicate comment in difference files. + * @license MIT + */ + + /*! Legal Foo */ /** @@ -5157,28 +5171,22 @@ Object { */ /** - * Duplicate comment in difference files. - * @license MIT + * Utility functions for the foo package. + * @license Apache-2.0 */ +// @lic + /** * Duplicate comment in same file. * @license MIT */ + /** * Information. * @license MIT */ - -/** - * Utility functions for the foo package. - * @license Apache-2.0 - */ - -/** @license Copyright 2112 Moon. **/ - -// @lic ", "filename/four.js": "/*! License information can be found in extracted-comments.js */ (()=>{var r={712:r=>{r.exports=Math.random()}},t={};!function e(o){if(t[o])return t[o].exports;var n=t[o]={exports:{}};return r[o](n,n.exports,e),n.exports}(712)})();", @@ -5445,6 +5453,15 @@ Object { (self.webpackChunkterser_webpack_plugin=self.webpackChunkterser_webpack_plugin||[]).push([[627],{627:e=>{e.exports=Math.random()}}]);", "extracted-comments.js": "/*! Legal Comment */ +/** @license Copyright 2112 Moon. **/ + + +/** + * Duplicate comment in difference files. + * @license MIT + */ + + /*! Legal Foo */ /** @@ -5455,28 +5472,22 @@ Object { */ /** - * Duplicate comment in difference files. - * @license MIT + * Utility functions for the foo package. + * @license Apache-2.0 */ +// @lic + /** * Duplicate comment in same file. * @license MIT */ + /** * Information. * @license MIT */ - -/** - * Utility functions for the foo package. - * @license Apache-2.0 - */ - -/** @license Copyright 2112 Moon. **/ - -// @lic ", "filename/four.js": "/*! License information can be found in extracted-comments.js */ (()=>{var r={712:r=>{r.exports=Math.random()}},t={};!function e(o){if(t[o])return t[o].exports;var n=t[o]={exports:{}};return r[o](n,n.exports,e),n.exports}(712)})();", @@ -5583,3 +5594,60 @@ r.exports=Math.random()}},t={};!function e(o){if(t[o])return t[o].exports;var n= exports[`extractComments option should match snapshot when no condition, preserve only \`/@license/i\` comments and extract "some" comments: errors 1`] = `Array []`; exports[`extractComments option should match snapshot when no condition, preserve only \`/@license/i\` comments and extract "some" comments: warnings 1`] = `Array []`; + +exports[`extractComments option should work with the existing licenses file: assets 1`] = ` +Object { + "chunks/627.627.js": "/*! For license information please see ../licenses.txt */ +(self.webpackChunkterser_webpack_plugin=self.webpackChunkterser_webpack_plugin||[]).push([[627],{627:e=>{e.exports=Math.random()}}]);", + "filename/four.js": "/*! For license information please see ../licenses.txt */ +(()=>{var r={712:r=>{r.exports=Math.random()}},t={};!function e(o){if(t[o])return t[o].exports;var n=t[o]={exports:{}};return r[o](n,n.exports,e),n.exports}(712)})();", + "filename/one.js": "/*! For license information please see ../licenses.txt */ +(()=>{var e,r,t={900:(e,r,t)=>{t.e(627).then(t.t.bind(t,627,7)),e.exports=Math.random()}},o={};function n(e){if(o[e])return o[e].exports;var r=o[e]={exports:{}};return t[e](r,r.exports,n),r.exports}n.m=t,n.t=function(e,r){if(1&r&&(e=this(e)),8&r)return e;if(4&r&&\\"object\\"==typeof e&&e&&e.__esModule)return e;var t=Object.create(null);n.r(t);var o={};if(2&r&&\\"object\\"==typeof e&&e)for(const r in e)o[r]=()=>e[r];return o.default=()=>e,n.d(t,o),t},n.d=(e,r)=>{for(var t in r)n.o(r,t)&&!n.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:r[t]})},n.f={},n.e=e=>Promise.all(Object.keys(n.f).reduce((r,t)=>(n.f[t](e,r),r),[])),n.u=e=>\\"chunks/\\"+e+\\".\\"+e+\\".js\\",n.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),e={},r=\\"terser-webpack-plugin:\\",n.l=(t,o,a)=>{if(e[t])e[t].push(o);else{var i,u;if(void 0!==a)for(var l=document.getElementsByTagName(\\"script\\"),s=0;s{i.onerror=i.onload=null,clearTimeout(c);var n=e[t];if(delete e[t],i.parentNode&&i.parentNode.removeChild(i),n&&n.forEach(e=>e(o)),r)return r(o)},c=setTimeout(d.bind(null,void 0,{type:\\"timeout\\",target:i}),12e4);i.onerror=d.bind(null,i.onerror),i.onload=d.bind(null,i.onload),u&&document.head.appendChild(i)}},n.r=e=>{\\"undefined\\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:\\"Module\\"}),Object.defineProperty(e,\\"__esModule\\",{value:!0})},n.p=\\"\\",(()=>{var e={255:0};n.f.j=(r,t)=>{var o=n.o(e,r)?e[r]:void 0;if(0!==o)if(o)t.push(o[2]);else{var a=new Promise((t,n)=>{o=e[r]=[t,n]});t.push(o[2]=a);var i=n.p+n.u(r),u=new Error;n.l(i,t=>{if(n.o(e,r)&&(0!==(o=e[r])&&(e[r]=void 0),o)){var a=t&&(\\"load\\"===t.type?\\"missing\\":t.type),i=t&&t.target&&t.target.src;u.message=\\"Loading chunk \\"+r+\\" failed.\\\\n(\\"+a+\\": \\"+i+\\")\\",u.name=\\"ChunkLoadError\\",u.type=a,u.request=i,o[1](u)}},\\"chunk-\\"+r)}};var r=self.webpackChunkterser_webpack_plugin=self.webpackChunkterser_webpack_plugin||[],t=r.push.bind(r);r.push=r=>{for(var o,a,[i,u,l]=r,s=0,p=[];s{var r={787:r=>{r.exports=Math.random()}},t={};!function e(o){if(t[o])return t[o].exports;var n=t[o]={exports:{}};return r[o](n,n.exports,e),n.exports}(787)})();", + "filename/two.js": "/*! For license information please see ../licenses.txt */ +(()=>{var r={353:r=>{r.exports=Math.random()}},t={};!function e(o){if(t[o])return t[o].exports;var n=t[o]={exports:{}};return r[o](n,n.exports,e),n.exports}(353)})();", + "licenses.txt": "// Existing Comment + +/** + * Duplicate comment in difference files. + * @license MIT + */ + + +/*! Legal Comment */ + +/*! Legal Foo */ + +/** + * @preserve Copyright 2009 SomeThirdParty. + * Here is the full license text and copyright + * notice for this file. Note that the notice can span several + * lines and is only terminated by the closing star and slash: + */ + +/** + * Utility functions for the foo package. + * @license Apache-2.0 + */ + +// @lic + + +/** + * Duplicate comment in same file. + * @license MIT + */ + + +/** + * Information. + * @license MIT + */ +", +} +`; + +exports[`extractComments option should work with the existing licenses file: errors 1`] = `Array []`; + +exports[`extractComments option should work with the existing licenses file: warnings 1`] = `Array []`; diff --git a/test/__snapshots__/worker.test.js.snap.webpack4 b/test/__snapshots__/worker.test.js.snap.webpack4 index 08977dfe..9ab27d99 100644 --- a/test/__snapshots__/worker.test.js.snap.webpack4 +++ b/test/__snapshots__/worker.test.js.snap.webpack4 @@ -1,43 +1,163 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`worker normalizes when terserOptions.output.comments is string: all: test2.js 1`] = ` +exports[`worker normalizes when minimizerOptions.output.comments is string: all 1`] = ` Object { - "code": "var foo=1;/* hello */", + "code": "var foo=1;/* hello */ +// Comment +/* duplicate */ +/* duplicate */", "extractedComments": Array [], } `; -exports[`worker should match snapshot when options.extractComments is regex: test1.js 1`] = ` +exports[`worker should match snapshot when minimizerOptions.compress.comments is boolean 1`] = ` +Object { + "code": "var foo=1;", + "extractedComments": Array [], +} +`; + +exports[`worker should match snapshot when minimizerOptions.compress.comments is object 1`] = ` +Object { + "code": "var foo=1;", + "extractedComments": Array [], +} +`; + +exports[`worker should match snapshot when minimizerOptions.extractComments is number 1`] = ` +Object { + "code": "var foo=1;", + "extractedComments": Array [], +} +`; + +exports[`worker should match snapshot when minimizerOptions.mangle is "null" 1`] = ` +Object { + "code": "var foo=1;", + "extractedComments": Array [], +} +`; + +exports[`worker should match snapshot when minimizerOptions.mangle is boolean 1`] = ` +Object { + "code": "var foo=1;", + "extractedComments": Array [], +} +`; + +exports[`worker should match snapshot when minimizerOptions.mangle is object 1`] = ` +Object { + "code": "var a=1;", + "extractedComments": Array [], +} +`; + +exports[`worker should match snapshot when minimizerOptions.output.comments is string: some 1`] = ` +Object { + "code": "var foo=1;", + "extractedComments": Array [], +} +`; + +exports[`worker should match snapshot when options.extractComments is "all" value 1`] = ` Object { "code": "var foo=1;", "extractedComments": Array [ "/* hello */", + "// Comment", + "/* duplicate */", ], } `; -exports[`worker should match snapshot when terserOptions.extractComments is number: test4.js 1`] = ` +exports[`worker should match snapshot when options.extractComments is "false" 1`] = ` Object { "code": "var foo=1;", "extractedComments": Array [], } `; -exports[`worker should match snapshot when terserOptions.output.comments is string: some: test3.js 1`] = ` +exports[`worker should match snapshot when options.extractComments is "some" value 1`] = ` +Object { + "code": "var foo=1;", + "extractedComments": Array [], +} +`; + +exports[`worker should match snapshot when options.extractComments is "true" 1`] = ` +Object { + "code": "var foo=1;", + "extractedComments": Array [], +} +`; + +exports[`worker should match snapshot when options.extractComments is "true" 2`] = ` +"var foo = 1;/* hello */ +// Comment +/* duplicate */ +/* duplicate */" +`; + +exports[`worker should match snapshot when options.extractComments is Function 1`] = ` +Object { + "code": "var foo=1;", + "extractedComments": Array [ + "/* hello */", + "// Comment", + "/* duplicate */", + ], +} +`; + +exports[`worker should match snapshot when options.extractComments is Object with "all" value 1`] = ` +Object { + "code": "var foo=1;", + "extractedComments": Array [ + "/* hello */", + "// Comment", + "/* duplicate */", + ], +} +`; + +exports[`worker should match snapshot when options.extractComments is Object with "some" value 1`] = ` +Object { + "code": "var foo=1;", + "extractedComments": Array [], +} +`; + +exports[`worker should match snapshot when options.extractComments is Object with "true" value 1`] = ` +Object { + "code": "var foo=1;", + "extractedComments": Array [], +} +`; + +exports[`worker should match snapshot when options.extractComments is RegExp 1`] = ` +Object { + "code": "var foo=1;", + "extractedComments": Array [ + "/* hello */", + ], +} +`; + +exports[`worker should match snapshot when options.extractComments is empty Object 1`] = ` Object { "code": "var foo=1;", "extractedComments": Array [], } `; -exports[`worker should match snapshot with extract option set to a single file: test5.js 1`] = ` +exports[`worker should match snapshot with extract option set to a single file 1`] = ` Object { "code": "/******/function hello(o){console.log(o)}", "extractedComments": Array [], } `; -exports[`worker should match snapshot with options.inputSourceMap: test6.js 1`] = ` +exports[`worker should match snapshot with options.inputSourceMap 1`] = ` Object { "code": "function foo(f){if(f)return bar()}", "extractedComments": Array [], diff --git a/test/__snapshots__/worker.test.js.snap.webpack5 b/test/__snapshots__/worker.test.js.snap.webpack5 index 08977dfe..9ab27d99 100644 --- a/test/__snapshots__/worker.test.js.snap.webpack5 +++ b/test/__snapshots__/worker.test.js.snap.webpack5 @@ -1,43 +1,163 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`worker normalizes when terserOptions.output.comments is string: all: test2.js 1`] = ` +exports[`worker normalizes when minimizerOptions.output.comments is string: all 1`] = ` Object { - "code": "var foo=1;/* hello */", + "code": "var foo=1;/* hello */ +// Comment +/* duplicate */ +/* duplicate */", "extractedComments": Array [], } `; -exports[`worker should match snapshot when options.extractComments is regex: test1.js 1`] = ` +exports[`worker should match snapshot when minimizerOptions.compress.comments is boolean 1`] = ` +Object { + "code": "var foo=1;", + "extractedComments": Array [], +} +`; + +exports[`worker should match snapshot when minimizerOptions.compress.comments is object 1`] = ` +Object { + "code": "var foo=1;", + "extractedComments": Array [], +} +`; + +exports[`worker should match snapshot when minimizerOptions.extractComments is number 1`] = ` +Object { + "code": "var foo=1;", + "extractedComments": Array [], +} +`; + +exports[`worker should match snapshot when minimizerOptions.mangle is "null" 1`] = ` +Object { + "code": "var foo=1;", + "extractedComments": Array [], +} +`; + +exports[`worker should match snapshot when minimizerOptions.mangle is boolean 1`] = ` +Object { + "code": "var foo=1;", + "extractedComments": Array [], +} +`; + +exports[`worker should match snapshot when minimizerOptions.mangle is object 1`] = ` +Object { + "code": "var a=1;", + "extractedComments": Array [], +} +`; + +exports[`worker should match snapshot when minimizerOptions.output.comments is string: some 1`] = ` +Object { + "code": "var foo=1;", + "extractedComments": Array [], +} +`; + +exports[`worker should match snapshot when options.extractComments is "all" value 1`] = ` Object { "code": "var foo=1;", "extractedComments": Array [ "/* hello */", + "// Comment", + "/* duplicate */", ], } `; -exports[`worker should match snapshot when terserOptions.extractComments is number: test4.js 1`] = ` +exports[`worker should match snapshot when options.extractComments is "false" 1`] = ` Object { "code": "var foo=1;", "extractedComments": Array [], } `; -exports[`worker should match snapshot when terserOptions.output.comments is string: some: test3.js 1`] = ` +exports[`worker should match snapshot when options.extractComments is "some" value 1`] = ` +Object { + "code": "var foo=1;", + "extractedComments": Array [], +} +`; + +exports[`worker should match snapshot when options.extractComments is "true" 1`] = ` +Object { + "code": "var foo=1;", + "extractedComments": Array [], +} +`; + +exports[`worker should match snapshot when options.extractComments is "true" 2`] = ` +"var foo = 1;/* hello */ +// Comment +/* duplicate */ +/* duplicate */" +`; + +exports[`worker should match snapshot when options.extractComments is Function 1`] = ` +Object { + "code": "var foo=1;", + "extractedComments": Array [ + "/* hello */", + "// Comment", + "/* duplicate */", + ], +} +`; + +exports[`worker should match snapshot when options.extractComments is Object with "all" value 1`] = ` +Object { + "code": "var foo=1;", + "extractedComments": Array [ + "/* hello */", + "// Comment", + "/* duplicate */", + ], +} +`; + +exports[`worker should match snapshot when options.extractComments is Object with "some" value 1`] = ` +Object { + "code": "var foo=1;", + "extractedComments": Array [], +} +`; + +exports[`worker should match snapshot when options.extractComments is Object with "true" value 1`] = ` +Object { + "code": "var foo=1;", + "extractedComments": Array [], +} +`; + +exports[`worker should match snapshot when options.extractComments is RegExp 1`] = ` +Object { + "code": "var foo=1;", + "extractedComments": Array [ + "/* hello */", + ], +} +`; + +exports[`worker should match snapshot when options.extractComments is empty Object 1`] = ` Object { "code": "var foo=1;", "extractedComments": Array [], } `; -exports[`worker should match snapshot with extract option set to a single file: test5.js 1`] = ` +exports[`worker should match snapshot with extract option set to a single file 1`] = ` Object { "code": "/******/function hello(o){console.log(o)}", "extractedComments": Array [], } `; -exports[`worker should match snapshot with options.inputSourceMap: test6.js 1`] = ` +exports[`worker should match snapshot with options.inputSourceMap 1`] = ` Object { "code": "function foo(f){if(f)return bar()}", "extractedComments": Array [], diff --git a/test/cache-option.test.js b/test/cache-option.test.js index aba1dbc7..4d686c0c 100644 --- a/test/cache-option.test.js +++ b/test/cache-option.test.js @@ -27,6 +27,15 @@ const otherOtherCacheDir = findCacheDir({ const otherOtherOtherCacheDir = findCacheDir({ name: 'other-other-other-cache-directory', }); +const otherOtherOtherOtherCacheDir = findCacheDir({ + name: 'other-other-other-other-cache-directory', +}); +const otherOtherOtherOtherOtherCacheDir = findCacheDir({ + name: 'other-other-other-other-other-cache-directory', +}); +const otherOtherOtherOtherOtherOtherCacheDir = findCacheDir({ + name: 'other-other-other-other-other-cache-directory', +}); jest.setTimeout(30000); @@ -37,11 +46,11 @@ if (getCompiler.isWebpack4()) { beforeEach(() => { compiler = getCompiler({ entry: { - one: `${__dirname}/fixtures/cache.js`, - two: `${__dirname}/fixtures/cache-1.js`, - three: `${__dirname}/fixtures/cache-2.js`, - four: `${__dirname}/fixtures/cache-3.js`, - five: `${__dirname}/fixtures/cache-4.js`, + one: path.resolve(__dirname, './fixtures/cache.js'), + two: path.resolve(__dirname, './fixtures/cache-1.js'), + three: path.resolve(__dirname, './fixtures/cache-2.js'), + four: path.resolve(__dirname, './fixtures/cache-3.js'), + five: path.resolve(__dirname, './fixtures/cache-4.js'), }, }); @@ -52,6 +61,9 @@ if (getCompiler.isWebpack4()) { removeCache(otherCacheDir), removeCache(otherOtherCacheDir), removeCache(otherOtherOtherCacheDir), + removeCache(otherOtherOtherOtherCacheDir), + removeCache(otherOtherOtherOtherOtherCacheDir), + removeCache(otherOtherOtherOtherOtherOtherCacheDir), ]); }); @@ -63,6 +75,9 @@ if (getCompiler.isWebpack4()) { removeCache(otherCacheDir), removeCache(otherOtherCacheDir), removeCache(otherOtherOtherCacheDir), + removeCache(otherOtherOtherOtherCacheDir), + removeCache(otherOtherOtherOtherOtherCacheDir), + removeCache(otherOtherOtherOtherOtherOtherCacheDir), ]); }); @@ -174,6 +189,163 @@ if (getCompiler.isWebpack4()) { getCacheDirectorySpy.mockRestore(); }); + it('should match snapshot for the "true" value and source maps', async () => { + compiler = getCompiler({ + devtool: 'source-map', + entry: { + one: path.resolve(__dirname, './fixtures/cache.js'), + two: path.resolve(__dirname, './fixtures/cache-1.js'), + three: path.resolve(__dirname, './fixtures/cache-2.js'), + four: path.resolve(__dirname, './fixtures/cache-3.js'), + five: path.resolve(__dirname, './fixtures/cache-4.js'), + }, + }); + + const cacacheGetSpy = jest.spyOn(cacache, 'get'); + const cacachePutSpy = jest.spyOn(cacache, 'put'); + + const getCacheDirectorySpy = jest + .spyOn(Webpack4Cache, 'getCacheDirectory') + .mockImplementation(() => { + return otherOtherOtherOtherCacheDir; + }); + + new TerserPlugin({ cache: true }).apply(compiler); + + const stats = await compile(compiler); + + expect(readsAssets(compiler, stats)).toMatchSnapshot('assets'); + expect(getErrors(stats)).toMatchSnapshot('errors'); + expect(getWarnings(stats)).toMatchSnapshot('warnings'); + + // Try to found cached files, but we don't have their in cache + expect(cacacheGetSpy).toHaveBeenCalledTimes(5); + // Put files in cache + expect(cacachePutSpy).toHaveBeenCalledTimes(5); + + cacache.get.mockClear(); + cacache.put.mockClear(); + + const newStats = await compile(compiler); + + expect(readsAssets(compiler, newStats)).toMatchSnapshot('assets'); + expect(getErrors(stats)).toMatchSnapshot('errors'); + expect(getWarnings(stats)).toMatchSnapshot('warnings'); + + // Now we have cached files so we get them and don't put new + expect(cacacheGetSpy).toHaveBeenCalledTimes(5); + expect(cacachePutSpy).toHaveBeenCalledTimes(0); + + cacacheGetSpy.mockRestore(); + cacachePutSpy.mockRestore(); + getCacheDirectorySpy.mockRestore(); + }); + + it('should match snapshot for the "true" value and extract comments in different files', async () => { + compiler = getCompiler({ + entry: { + one: path.resolve(__dirname, './fixtures/comments.js'), + two: path.resolve(__dirname, './fixtures/comments-2.js'), + three: path.resolve(__dirname, './fixtures/comments-3.js'), + four: path.resolve(__dirname, './fixtures/comments-4.js'), + }, + }); + + const cacacheGetSpy = jest.spyOn(cacache, 'get'); + const cacachePutSpy = jest.spyOn(cacache, 'put'); + + const getCacheDirectorySpy = jest + .spyOn(Webpack4Cache, 'getCacheDirectory') + .mockImplementation(() => { + return otherOtherOtherOtherOtherCacheDir; + }); + + new TerserPlugin({ cache: true }).apply(compiler); + + const stats = await compile(compiler); + + expect(readsAssets(compiler, stats)).toMatchSnapshot('assets'); + expect(getErrors(stats)).toMatchSnapshot('errors'); + expect(getWarnings(stats)).toMatchSnapshot('warnings'); + + // Try to found cached files, but we don't have their in cache + expect(cacacheGetSpy).toHaveBeenCalledTimes(5); + // Put files in cache + expect(cacachePutSpy).toHaveBeenCalledTimes(5); + + cacache.get.mockClear(); + cacache.put.mockClear(); + + const newStats = await compile(compiler); + + expect(readsAssets(compiler, newStats)).toMatchSnapshot('assets'); + expect(getErrors(stats)).toMatchSnapshot('errors'); + expect(getWarnings(stats)).toMatchSnapshot('warnings'); + + // Now we have cached files so we get them and don't put new + expect(cacacheGetSpy).toHaveBeenCalledTimes(5); + expect(cacachePutSpy).toHaveBeenCalledTimes(0); + + cacacheGetSpy.mockRestore(); + cacachePutSpy.mockRestore(); + getCacheDirectorySpy.mockRestore(); + }); + + it('should match snapshot for the "true" value and extract comments in one files', async () => { + compiler = getCompiler({ + entry: { + one: path.resolve(__dirname, './fixtures/comments.js'), + two: path.resolve(__dirname, './fixtures/comments-2.js'), + three: path.resolve(__dirname, './fixtures/comments-3.js'), + four: path.resolve(__dirname, './fixtures/comments-4.js'), + }, + }); + + const cacacheGetSpy = jest.spyOn(cacache, 'get'); + const cacachePutSpy = jest.spyOn(cacache, 'put'); + + const getCacheDirectorySpy = jest + .spyOn(Webpack4Cache, 'getCacheDirectory') + .mockImplementation(() => { + return otherOtherOtherOtherOtherOtherCacheDir; + }); + + new TerserPlugin({ + cache: true, + extractComments: { + filename: 'licenses.txt', + }, + }).apply(compiler); + + const stats = await compile(compiler); + + expect(readsAssets(compiler, stats)).toMatchSnapshot('assets'); + expect(getErrors(stats)).toMatchSnapshot('errors'); + expect(getWarnings(stats)).toMatchSnapshot('warnings'); + + // Try to found cached files, but we don't have their in cache + expect(cacacheGetSpy).toHaveBeenCalledTimes(9); + // Put files in cache + expect(cacachePutSpy).toHaveBeenCalledTimes(9); + + cacache.get.mockClear(); + cacache.put.mockClear(); + + const newStats = await compile(compiler); + + expect(readsAssets(compiler, newStats)).toMatchSnapshot('assets'); + expect(getErrors(stats)).toMatchSnapshot('errors'); + expect(getWarnings(stats)).toMatchSnapshot('warnings'); + + // Now we have cached files so we get them and don't put new + expect(cacacheGetSpy).toHaveBeenCalledTimes(9); + expect(cacachePutSpy).toHaveBeenCalledTimes(0); + + cacacheGetSpy.mockRestore(); + cacachePutSpy.mockRestore(); + getCacheDirectorySpy.mockRestore(); + }); + it('should match snapshot for the "other-cache-directory" value', async () => { const cacacheGetSpy = jest.spyOn(cacache, 'get'); const cacachePutSpy = jest.spyOn(cacache, 'put'); @@ -290,11 +462,11 @@ if (getCompiler.isWebpack4()) { compiler = getCompiler({ entry: { - onne: `${__dirname}/fixtures/cache.js`, - two: `${__dirname}/fixtures/cache-1.js`, - three: `${__dirname}/fixtures/cache-2.js`, - four: `${__dirname}/fixtures/cache-3.js`, - five: `${__dirname}/fixtures/cache-4.js`, + onne: path.resolve(__dirname, './fixtures/cache.js'), + two: path.resolve(__dirname, './fixtures/cache-1.js'), + three: path.resolve(__dirname, './fixtures/cache-2.js'), + four: path.resolve(__dirname, './fixtures/cache-3.js'), + five: path.resolve(__dirname, './fixtures/cache-4.js'), }, }); @@ -331,11 +503,11 @@ if (getCompiler.isWebpack4()) { it('should work with "false" value for the "cache" option', async () => { const compiler = getCompiler({ entry: { - one: `${__dirname}/fixtures/cache.js`, - two: `${__dirname}/fixtures/cache-1.js`, - three: `${__dirname}/fixtures/cache-2.js`, - four: `${__dirname}/fixtures/cache-3.js`, - five: `${__dirname}/fixtures/cache-4.js`, + one: path.resolve(__dirname, './fixtures/cache.js'), + two: path.resolve(__dirname, './fixtures/cache-1.js'), + three: path.resolve(__dirname, './fixtures/cache-2.js'), + four: path.resolve(__dirname, './fixtures/cache-3.js'), + five: path.resolve(__dirname, './fixtures/cache-4.js'), }, cache: false, }); @@ -391,11 +563,11 @@ if (getCompiler.isWebpack4()) { it('should work with "memory" value for the "cache.type" option', async () => { const compiler = getCompiler({ entry: { - one: `${__dirname}/fixtures/cache.js`, - two: `${__dirname}/fixtures/cache-1.js`, - three: `${__dirname}/fixtures/cache-2.js`, - four: `${__dirname}/fixtures/cache-3.js`, - five: `${__dirname}/fixtures/cache-4.js`, + one: path.resolve(__dirname, './fixtures/cache.js'), + two: path.resolve(__dirname, './fixtures/cache-1.js'), + three: path.resolve(__dirname, './fixtures/cache-2.js'), + four: path.resolve(__dirname, './fixtures/cache-3.js'), + five: path.resolve(__dirname, './fixtures/cache-4.js'), }, cache: { type: 'memory', @@ -454,11 +626,11 @@ if (getCompiler.isWebpack4()) { it('should work with "filesystem" value for the "cache.type" option', async () => { const compiler = getCompiler({ entry: { - one: `${__dirname}/fixtures/cache.js`, - two: `${__dirname}/fixtures/cache-1.js`, - three: `${__dirname}/fixtures/cache-2.js`, - four: `${__dirname}/fixtures/cache-3.js`, - five: `${__dirname}/fixtures/cache-4.js`, + one: path.resolve(__dirname, './fixtures/cache.js'), + two: path.resolve(__dirname, './fixtures/cache-1.js'), + three: path.resolve(__dirname, './fixtures/cache-2.js'), + four: path.resolve(__dirname, './fixtures/cache-3.js'), + five: path.resolve(__dirname, './fixtures/cache-4.js'), }, cache: { type: 'filesystem', diff --git a/test/exclude-option.test.js b/test/exclude-option.test.js index 3ea148fe..442937c1 100644 --- a/test/exclude-option.test.js +++ b/test/exclude-option.test.js @@ -1,3 +1,5 @@ +import path from 'path'; + import TerserPlugin from '../src/index'; import { @@ -15,9 +17,9 @@ describe('exclude option', () => { beforeEach(() => { compiler = getCompiler({ entry: { - excluded1: `${__dirname}/fixtures/excluded1.js`, - excluded2: `${__dirname}/fixtures/excluded2.js`, - entry: `${__dirname}/fixtures/entry.js`, + excluded1: path.resolve(__dirname, './fixtures/excluded1.js'), + excluded2: path.resolve(__dirname, './fixtures/excluded2.js'), + entry: path.resolve(__dirname, './fixtures/entry.js'), }, }); diff --git a/test/extractComments-option.test.js b/test/extractComments-option.test.js index 99cf5025..e81db225 100644 --- a/test/extractComments-option.test.js +++ b/test/extractComments-option.test.js @@ -1,3 +1,5 @@ +import path from 'path'; + import webpack from 'webpack'; import TerserPlugin from '../src/index'; @@ -9,6 +11,7 @@ import { getWarnings, readsAssets, removeCache, + ExistingCommentsFile, } from './helpers'; function createFilenameFn() { @@ -27,10 +30,10 @@ describe('extractComments option', () => { beforeEach(() => { compiler = getCompiler({ entry: { - one: `${__dirname}/fixtures/comments.js`, - two: `${__dirname}/fixtures/comments-2.js`, - three: `${__dirname}/fixtures/comments-3.js`, - four: `${__dirname}/fixtures/comments-4.js`, + one: path.resolve(__dirname, './fixtures/comments.js'), + two: path.resolve(__dirname, './fixtures/comments-2.js'), + three: path.resolve(__dirname, './fixtures/comments-3.js'), + four: path.resolve(__dirname, './fixtures/comments-4.js'), }, output: { filename: 'filename/[name].js', @@ -265,10 +268,10 @@ describe('extractComments option', () => { it('should match snapshot when extracts comments to files with query string', async () => { compiler = getCompiler({ entry: { - one: `${__dirname}/fixtures/comments.js`, - two: `${__dirname}/fixtures/comments-2.js`, - three: `${__dirname}/fixtures/comments-3.js`, - four: `${__dirname}/fixtures/comments-4.js`, + one: path.resolve(__dirname, './fixtures/comments.js'), + two: path.resolve(__dirname, './fixtures/comments-2.js'), + three: path.resolve(__dirname, './fixtures/comments-3.js'), + four: path.resolve(__dirname, './fixtures/comments-4.js'), }, output: { filename: 'filename/[name].js?[chunkhash]', @@ -288,10 +291,10 @@ describe('extractComments option', () => { it('should match snapshot when extracts comments to files with query string and with placeholders', async () => { compiler = getCompiler({ entry: { - one: `${__dirname}/fixtures/comments.js`, - two: `${__dirname}/fixtures/comments-2.js`, - three: `${__dirname}/fixtures/comments-3.js`, - four: `${__dirname}/fixtures/comments-4.js`, + one: path.resolve(__dirname, './fixtures/comments.js'), + two: path.resolve(__dirname, './fixtures/comments-2.js'), + three: path.resolve(__dirname, './fixtures/comments-3.js'), + four: path.resolve(__dirname, './fixtures/comments-4.js'), }, output: { filename: 'filename/[name].js?[chunkhash]', @@ -323,10 +326,10 @@ describe('extractComments option', () => { compiler = getCompiler({ entry: { - one: `${__dirname}/fixtures/comments.js`, - two: `${__dirname}/fixtures/comments-2.js`, - three: `${__dirname}/fixtures/comments-3.js`, - four: `${__dirname}/fixtures/comments-4.js`, + one: path.resolve(__dirname, './fixtures/comments.js'), + two: path.resolve(__dirname, './fixtures/comments-2.js'), + three: path.resolve(__dirname, './fixtures/comments-3.js'), + four: path.resolve(__dirname, './fixtures/comments-4.js'), }, output: { filename: 'filename/[name].js?[chunkhash]', @@ -351,7 +354,7 @@ describe('extractComments option', () => { it('should match snapshot for nested comment file', async () => { compiler = getCompiler({ entry: { - one: `${__dirname}/fixtures/comments.js`, + one: path.resolve(__dirname, './fixtures/comments.js'), }, }); @@ -372,7 +375,7 @@ describe('extractComments option', () => { it('should match snapshot for comment file when filename is nested', async () => { compiler = getCompiler({ entry: { - one: `${__dirname}/fixtures/comments.js`, + one: path.resolve(__dirname, './fixtures/comments.js'), }, output: { filename: 'nested/directory/[name].js?[chunkhash]', @@ -596,8 +599,8 @@ describe('extractComments option', () => { it('should match snapshot and keep shebang', async () => { compiler = getCompiler({ entry: { - shebang: `${__dirname}/fixtures/shebang.js`, - shebang1: `${__dirname}/fixtures/shebang-1.js`, + shebang: path.resolve(__dirname, './fixtures/shebang.js'), + shebang1: path.resolve(__dirname, './fixtures/shebang-1.js'), }, target: 'node', plugins: [ @@ -613,4 +616,19 @@ describe('extractComments option', () => { expect(getErrors(stats)).toMatchSnapshot('errors'); expect(getWarnings(stats)).toMatchSnapshot('warnings'); }); + + it('should work with the existing licenses file', async () => { + new ExistingCommentsFile().apply(compiler); + new TerserPlugin({ + extractComments: { + filename: 'licenses.txt', + }, + }).apply(compiler); + + const stats = await compile(compiler); + + expect(readsAssets(compiler, stats)).toMatchSnapshot('assets'); + expect(getErrors(stats)).toMatchSnapshot('errors'); + expect(getWarnings(stats)).toMatchSnapshot('warnings'); + }); }); diff --git a/test/helpers/BrokenCodePlugin.js b/test/helpers/BrokenCodePlugin.js index 8a17417d..b35e78dd 100644 --- a/test/helpers/BrokenCodePlugin.js +++ b/test/helpers/BrokenCodePlugin.js @@ -1,4 +1,9 @@ -import { RawSource } from 'webpack-sources'; +import webpack from 'webpack'; + +// webpack 5 exposes the sources property to ensure the right version of webpack-sources is used +const { RawSource } = + // eslint-disable-next-line global-require + webpack.sources || require('webpack-sources'); export default class BrokenCodePlugin { apply(compiler) { diff --git a/test/helpers/ExistingCommentsFile.js b/test/helpers/ExistingCommentsFile.js new file mode 100644 index 00000000..7c1c7a9a --- /dev/null +++ b/test/helpers/ExistingCommentsFile.js @@ -0,0 +1,21 @@ +import webpack from 'webpack'; + +// webpack 5 exposes the sources property to ensure the right version of webpack-sources is used +const { RawSource } = + // eslint-disable-next-line global-require + webpack.sources || require('webpack-sources'); + +export default class ExistingCommentsFile { + apply(compiler) { + const plugin = { name: this.constructor.name }; + + compiler.hooks.thisCompilation.tap(plugin, (compilation) => { + compilation.hooks.additionalAssets.tap(plugin, () => { + // eslint-disable-next-line no-param-reassign + compilation.assets['licenses.txt'] = new RawSource( + '// Existing Comment' + ); + }); + }); + } +} diff --git a/test/helpers/ModifyExistingAsset.js b/test/helpers/ModifyExistingAsset.js new file mode 100644 index 00000000..702fb188 --- /dev/null +++ b/test/helpers/ModifyExistingAsset.js @@ -0,0 +1,28 @@ +import webpack from 'webpack'; + +// webpack 5 exposes the sources property to ensure the right version of webpack-sources is used +const { ConcatSource } = + // eslint-disable-next-line global-require + webpack.sources || require('webpack-sources'); + +export default class ExistingCommentsFile { + constructor(options = {}) { + this.options = options; + } + + apply(compiler) { + const plugin = { name: this.constructor.name }; + + compiler.hooks.thisCompilation.tap(plugin, (compilation) => { + compilation.hooks.additionalAssets.tap(plugin, () => { + // eslint-disable-next-line no-param-reassign + compilation.assets[this.options.name] = new ConcatSource( + `function changed() {} ${ + this.options.comment ? '/*! CHANGED */' : '' + }`, + compilation.assets[this.options.name] + ); + }); + }); + } +} diff --git a/test/helpers/getCompiler.js b/test/helpers/getCompiler.js index 7f14a00d..c02e880e 100644 --- a/test/helpers/getCompiler.js +++ b/test/helpers/getCompiler.js @@ -10,7 +10,6 @@ export default function getCompiler(options = {}) { : { mode: 'production', bail: true, - cache: getCompiler.isWebpack4() ? false : { type: 'memory' }, entry: path.resolve(__dirname, '../fixtures/entry.js'), optimization: { minimize: false, diff --git a/test/helpers/index.js b/test/helpers/index.js index ccddbb17..993d136c 100644 --- a/test/helpers/index.js +++ b/test/helpers/index.js @@ -2,10 +2,12 @@ import BrokenCodePlugin from './BrokenCodePlugin'; import compile from './compile'; import countPlugins from './countPlugins'; import execute from './execute'; +import ExistingCommentsFile from './ExistingCommentsFile'; import getCacheDirectory from './getCacheDirectory'; import getCompiler from './getCompiler'; import getErrors from './getErrors'; import getWarnings from './getWarnings'; +import ModifyExistingAsset from './ModifyExistingAsset'; import readAsset from './readAsset'; import readsAssets from './readAssets'; import normalizeErrors from './normalizeErrors'; @@ -15,11 +17,13 @@ export { BrokenCodePlugin, compile, countPlugins, + ExistingCommentsFile, execute, getCacheDirectory, getCompiler, getErrors, getWarnings, + ModifyExistingAsset, normalizeErrors, readAsset, readsAssets, diff --git a/test/include-option.test.js b/test/include-option.test.js index 63652d2c..142ad13a 100644 --- a/test/include-option.test.js +++ b/test/include-option.test.js @@ -1,3 +1,5 @@ +import path from 'path'; + import TerserPlugin from '../src/index'; import { @@ -15,9 +17,9 @@ describe('include option', () => { beforeEach(() => { compiler = getCompiler({ entry: { - included1: `${__dirname}/fixtures/included1.js`, - included2: `${__dirname}/fixtures/included2.js`, - entry: `${__dirname}/fixtures/entry.js`, + included1: path.resolve(__dirname, './fixtures/included1.js'), + included2: path.resolve(__dirname, './fixtures/included2.js'), + entry: path.resolve(__dirname, './fixtures/entry.js'), }, }); diff --git a/test/minify-option.test.js b/test/minify-option.test.js index 8242af5b..6f3b622c 100644 --- a/test/minify-option.test.js +++ b/test/minify-option.test.js @@ -1,3 +1,5 @@ +import path from 'path'; + import TerserPlugin from '../src'; import { @@ -16,10 +18,10 @@ describe('minify option', () => { it('should snapshot for the "uglify-js" minifier', async () => { const compiler = getCompiler({ - entry: `${__dirname}/fixtures/minify/es5.js`, + entry: path.resolve(__dirname, './fixtures/minify/es5.js'), output: { ...(getCompiler.isWebpack4() ? {} : { ecmaVersion: 5 }), - path: `${__dirname}/dist-uglify-js`, + path: path.resolve(__dirname, './dist-uglify-js'), filename: '[name].js', chunkFilename: '[id].[name].js', }, @@ -45,10 +47,10 @@ describe('minify option', () => { it('should snapshot snapshot for the "uglify-js" minifier with extracting comments', async () => { const compiler = getCompiler({ - entry: `${__dirname}/fixtures/minify/es5.js`, + entry: path.resolve(__dirname, './fixtures/minify/es5.js'), output: { ...(getCompiler.isWebpack4() ? {} : { ecmaVersion: 5 }), - path: `${__dirname}/dist-uglify-js`, + path: path.resolve(__dirname, './dist-uglify-js'), filename: '[name].js', chunkFilename: '[id].[name].js', }, @@ -75,9 +77,9 @@ describe('minify option', () => { it('should snapshot for the "terser" minifier', async () => { const compiler = getCompiler({ - entry: `${__dirname}/fixtures/minify/es6.js`, + entry: path.resolve(__dirname, './fixtures/minify/es6.js'), output: { - path: `${__dirname}/dist-terser`, + path: path.resolve(__dirname, './dist-terser'), filename: '[name].js', chunkFilename: '[id].[name].js', }, @@ -104,9 +106,9 @@ describe('minify option', () => { it('should snapshot snapshot for "terser" minifier when the "sourceMap" option is "true"', async () => { const compiler = getCompiler({ devtool: 'source-map', - entry: `${__dirname}/fixtures/minify/es6.js`, + entry: path.resolve(__dirname, './fixtures/minify/es6.js'), output: { - path: `${__dirname}/dist-terser`, + path: path.resolve(__dirname, './dist-terser'), filename: '[name].js', chunkFilename: '[id].[name].js', }, @@ -141,9 +143,9 @@ describe('minify option', () => { it('should snapshot for the "terser" minifier when the "parallel" option is "true"', async () => { const compiler = getCompiler({ - entry: `${__dirname}/fixtures/minify/es6.js`, + entry: path.resolve(__dirname, './fixtures/minify/es6.js'), output: { - path: `${__dirname}/dist-terser`, + path: path.resolve(__dirname, './dist-terser'), filename: '[name].js', chunkFilename: '[id].[name].js', }, @@ -170,9 +172,9 @@ describe('minify option', () => { it('should snapshot for errors into the "minify" option', async () => { const compiler = getCompiler({ - entry: `${__dirname}/fixtures/minify/es6.js`, + entry: path.resolve(__dirname, './fixtures/minify/es6.js'), output: { - path: `${__dirname}/dist-terser`, + path: path.resolve(__dirname, './dist-terser'), filename: '[name].js', chunkFilename: '[id].[name].js', }, @@ -192,9 +194,9 @@ describe('minify option', () => { it('should snapshot for errors into the "minify" option when the "parallel" option is "true"', async () => { const compiler = getCompiler({ - entry: `${__dirname}/fixtures/minify/es6.js`, + entry: path.resolve(__dirname, './fixtures/minify/es6.js'), output: { - path: `${__dirname}/dist-terser`, + path: path.resolve(__dirname, './dist-terser'), filename: '[name].js', chunkFilename: '[id].[name].js', }, diff --git a/test/parallel-option.test.js b/test/parallel-option.test.js index eb72dec9..22a9d363 100644 --- a/test/parallel-option.test.js +++ b/test/parallel-option.test.js @@ -1,3 +1,4 @@ +import path from 'path'; import os from 'os'; import Worker from 'jest-worker'; @@ -52,10 +53,10 @@ describe('parallel option', () => { compiler = getCompiler({ entry: { - one: `${__dirname}/fixtures/entry.js`, - two: `${__dirname}/fixtures/entry.js`, - three: `${__dirname}/fixtures/entry.js`, - four: `${__dirname}/fixtures/entry.js`, + one: path.resolve(__dirname, './fixtures/entry.js'), + two: path.resolve(__dirname, './fixtures/entry.js'), + three: path.resolve(__dirname, './fixtures/entry.js'), + four: path.resolve(__dirname, './fixtures/entry.js'), }, }); @@ -135,7 +136,7 @@ describe('parallel option', () => { it('should match snapshot for the "true" value when only one file passed', async () => { compiler = getCompiler({ - entry: `${__dirname}/fixtures/entry.js`, + entry: path.resolve(__dirname, './fixtures/entry.js'), }); new TerserPlugin({ parallel: true }).apply(compiler); @@ -160,7 +161,7 @@ describe('parallel option', () => { const entries = {}; for (let i = 0; i < os.cpus().length / 2; i++) { - entries[`entry-${i}`] = `${__dirname}/fixtures/entry.js`; + entries[`entry-${i}`] = path.resolve(__dirname, './fixtures/entry.js'); } compiler = getCompiler({ entry: entries }); @@ -187,7 +188,7 @@ describe('parallel option', () => { const entries = {}; for (let i = 0; i < os.cpus().length; i++) { - entries[`entry-${i}`] = `${__dirname}/fixtures/entry.js`; + entries[`entry-${i}`] = path.resolve(__dirname, './fixtures/entry.js'); } compiler = getCompiler({ entry: entries }); @@ -214,19 +215,19 @@ describe('parallel option', () => { const entries = {}; for (let i = 0; i < os.cpus().length * 2; i++) { - entries[`entry-${i}`] = `${__dirname}/fixtures/entry.js`; + entries[`entry-${i}`] = path.resolve(__dirname, './fixtures/entry.js'); } compiler = getCompiler({ entry: { - one: `${__dirname}/fixtures/entry.js`, - two: `${__dirname}/fixtures/entry.js`, - three: `${__dirname}/fixtures/entry.js`, - four: `${__dirname}/fixtures/entry.js`, - five: `${__dirname}/fixtures/entry.js`, - six: `${__dirname}/fixtures/entry.js`, - seven: `${__dirname}/fixtures/entry.js`, - eight: `${__dirname}/fixtures/entry.js`, + one: path.resolve(__dirname, './fixtures/entry.js'), + two: path.resolve(__dirname, './fixtures/entry.js'), + three: path.resolve(__dirname, './fixtures/entry.js'), + four: path.resolve(__dirname, './fixtures/entry.js'), + five: path.resolve(__dirname, './fixtures/entry.js'), + six: path.resolve(__dirname, './fixtures/entry.js'), + seven: path.resolve(__dirname, './fixtures/entry.js'), + eight: path.resolve(__dirname, './fixtures/entry.js'), }, }); diff --git a/test/sourceMap-option.test.js b/test/sourceMap-option.test.js index f0acb17f..ac09961a 100644 --- a/test/sourceMap-option.test.js +++ b/test/sourceMap-option.test.js @@ -1,3 +1,5 @@ +import path from 'path'; + import { SourceMapDevToolPlugin } from 'webpack'; import TerserPlugin from '../src/index'; @@ -34,7 +36,7 @@ describe('sourceMap', () => { it('should match snapshot for a "false" value (the "devtool" option has the "source-map" value)', async () => { const compiler = getCompiler({ - entry: `${__dirname}/fixtures/entry.js`, + entry: path.resolve(__dirname, './fixtures/entry.js'), devtool: 'source-map', }); @@ -49,7 +51,7 @@ describe('sourceMap', () => { it('should match snapshot for a "false" value (the "devtool" option has the "false" value)', async () => { const compiler = getCompiler({ - entry: `${__dirname}/fixtures/entry.js`, + entry: path.resolve(__dirname, './fixtures/entry.js'), devtool: false, }); @@ -64,7 +66,7 @@ describe('sourceMap', () => { it('should match snapshot for a "true" value (the "devtool" option has the "source-map" value)', async () => { const compiler = getCompiler({ - entry: `${__dirname}/fixtures/entry.js`, + entry: path.resolve(__dirname, './fixtures/entry.js'), devtool: 'source-map', }); @@ -79,7 +81,7 @@ describe('sourceMap', () => { it('should match snapshot for a "true" value (the "devtool" option has the "inline-source-map" value)', async () => { const compiler = getCompiler({ - entry: `${__dirname}/fixtures/entry.js`, + entry: path.resolve(__dirname, './fixtures/entry.js'), devtool: 'inline-source-map', }); @@ -94,7 +96,7 @@ describe('sourceMap', () => { it('should match snapshot for a "true" value (the "devtool" option has the "hidden-source-map" value)', async () => { const compiler = getCompiler({ - entry: `${__dirname}/fixtures/entry.js`, + entry: path.resolve(__dirname, './fixtures/entry.js'), devtool: 'hidden-source-map', }); @@ -109,7 +111,7 @@ describe('sourceMap', () => { it('should match snapshot for a "true" value (the "devtool" option has the "nosources-source-map" value)', async () => { const compiler = getCompiler({ - entry: `${__dirname}/fixtures/entry.js`, + entry: path.resolve(__dirname, './fixtures/entry.js'), devtool: 'nosources-source-map', }); @@ -124,7 +126,7 @@ describe('sourceMap', () => { it('should match snapshot for a "true" value (the "devtool" option has the "false" value)', async () => { const compiler = getCompiler({ - entry: `${__dirname}/fixtures/entry.js`, + entry: path.resolve(__dirname, './fixtures/entry.js'), devtool: false, }); @@ -175,7 +177,7 @@ describe('sourceMap', () => { } })(); const compiler = getCompiler({ - entry: `${__dirname}/fixtures/entry.js`, + entry: path.resolve(__dirname, './fixtures/entry.js'), devtool: 'source-map', plugins: [emitBrokenSourceMapPlugin], }); @@ -192,7 +194,7 @@ describe('sourceMap', () => { it('should match snapshot when the "devtool" option has the "source-map" value', async () => { const compiler = getCompiler({ - entry: `${__dirname}/fixtures/entry.js`, + entry: path.resolve(__dirname, './fixtures/entry.js'), devtool: 'source-map', }); @@ -208,7 +210,7 @@ describe('sourceMap', () => { if (getCompiler.isWebpack4()) { it('should match snapshot when the "devtool" option has the "sourcemap" value', async () => { const compiler = getCompiler({ - entry: `${__dirname}/fixtures/entry.js`, + entry: path.resolve(__dirname, './fixtures/entry.js'), devtool: 'sourcemap', }); @@ -224,7 +226,7 @@ describe('sourceMap', () => { it('should match snapshot when the "devtool" option has the "source-map" value', async () => { const compiler = getCompiler({ - entry: `${__dirname}/fixtures/entry.js`, + entry: path.resolve(__dirname, './fixtures/entry.js'), devtool: 'inline-source-map', }); @@ -239,7 +241,7 @@ describe('sourceMap', () => { it('should match snapshot when the "devtool" option has the "source-map" value', async () => { const compiler = getCompiler({ - entry: `${__dirname}/fixtures/entry.js`, + entry: path.resolve(__dirname, './fixtures/entry.js'), devtool: 'hidden-source-map', }); @@ -254,7 +256,7 @@ describe('sourceMap', () => { it('should match snapshot when the "devtool" option has the "source-map" value', async () => { const compiler = getCompiler({ - entry: `${__dirname}/fixtures/entry.js`, + entry: path.resolve(__dirname, './fixtures/entry.js'), devtool: 'nosources-source-map', }); @@ -269,7 +271,7 @@ describe('sourceMap', () => { it('should match snapshot for a "true" value (the "devtool" option has the "eval" value)', async () => { const compiler = getCompiler({ - entry: `${__dirname}/fixtures/entry.js`, + entry: path.resolve(__dirname, './fixtures/entry.js'), devtool: 'eval', }); @@ -284,7 +286,7 @@ describe('sourceMap', () => { it('should match snapshot for a "true" value (the "devtool" option has the "cheap-source-map" value)', async () => { const compiler = getCompiler({ - entry: `${__dirname}/fixtures/entry.js`, + entry: path.resolve(__dirname, './fixtures/entry.js'), devtool: 'cheap-source-map', }); @@ -299,7 +301,7 @@ describe('sourceMap', () => { it('should match snapshot for the `SourceMapDevToolPlugin` plugin (like `source-map`)', async () => { const compiler = getCompiler({ - entry: `${__dirname}/fixtures/entry.js`, + entry: path.resolve(__dirname, './fixtures/entry.js'), devtool: false, plugins: [ new SourceMapDevToolPlugin({ @@ -321,7 +323,7 @@ describe('sourceMap', () => { it('should match snapshot for the `SourceMapDevToolPlugin` plugin (like `cheap-source-map`)', async () => { const compiler = getCompiler({ - entry: `${__dirname}/fixtures/entry.js`, + entry: path.resolve(__dirname, './fixtures/entry.js'), devtool: false, plugins: [ new SourceMapDevToolPlugin({ @@ -348,9 +350,9 @@ describe('sourceMap', () => { devtool: 'eval', bail: true, cache: getCompiler.isWebpack4() ? false : { type: 'memory' }, - entry: `${__dirname}/fixtures/entry.js`, + entry: path.resolve(__dirname, './fixtures/entry.js'), output: { - path: `${__dirname}/dist`, + path: path.resolve(__dirname, './dist'), filename: '[name]-1.js', chunkFilename: '[id]-1.[name].js', }, @@ -364,9 +366,9 @@ describe('sourceMap', () => { devtool: 'source-map', bail: true, cache: getCompiler.isWebpack4() ? false : { type: 'memory' }, - entry: `${__dirname}/fixtures/entry.js`, + entry: path.resolve(__dirname, './fixtures/entry.js'), output: { - path: `${__dirname}/dist`, + path: path.resolve(__dirname, './dist'), filename: '[name]-2.js', chunkFilename: '[id]-2.[name].js', }, @@ -380,9 +382,9 @@ describe('sourceMap', () => { bail: true, cache: getCompiler.isWebpack4() ? false : { type: 'memory' }, devtool: false, - entry: `${__dirname}/fixtures/entry.js`, + entry: path.resolve(__dirname, './fixtures/entry.js'), output: { - path: `${__dirname}/dist`, + path: path.resolve(__dirname, './dist'), filename: '[name]-3.js', chunkFilename: '[id]-3.[name].js', }, @@ -403,9 +405,9 @@ describe('sourceMap', () => { bail: true, cache: getCompiler.isWebpack4() ? false : { type: 'memory' }, devtool: false, - entry: `${__dirname}/fixtures/entry.js`, + entry: path.resolve(__dirname, './fixtures/entry.js'), output: { - path: `${__dirname}/dist`, + path: path.resolve(__dirname, './dist'), filename: '[name]-4.js', chunkFilename: '[id]-4.[name].js', }, diff --git a/test/terserOptions-option.test.js b/test/terserOptions-option.test.js index 74e5c8e8..87d286a7 100644 --- a/test/terserOptions-option.test.js +++ b/test/terserOptions-option.test.js @@ -1,3 +1,5 @@ +import path from 'path'; + import TerserPlugin from '../src/index'; import { @@ -16,7 +18,7 @@ describe('terserOptions option', () => { it('should match snapshot for the "ecma" option with the "5" value', async () => { const compiler = getCompiler({ - entry: `${__dirname}/fixtures/ecma-5/entry.js`, + entry: path.resolve(__dirname, './fixtures/ecma-5/entry.js'), }); new TerserPlugin({ @@ -38,7 +40,7 @@ describe('terserOptions option', () => { it('should match snapshot for the "ecma" option with the "6" value', async () => { const compiler = getCompiler({ - entry: `${__dirname}/fixtures/ecma-6/entry.js`, + entry: path.resolve(__dirname, './fixtures/ecma-6/entry.js'), }); new TerserPlugin({ @@ -60,7 +62,7 @@ describe('terserOptions option', () => { it('should match snapshot for the "ecma" option with the "7" value', async () => { const compiler = getCompiler({ - entry: `${__dirname}/fixtures/ecma-7/entry.js`, + entry: path.resolve(__dirname, './fixtures/ecma-7/entry.js'), }); new TerserPlugin({ @@ -82,7 +84,7 @@ describe('terserOptions option', () => { it('should match snapshot for the "ecma" option with the "8" value', async () => { const compiler = getCompiler({ - entry: `${__dirname}/fixtures/ecma-8/entry.js`, + entry: path.resolve(__dirname, './fixtures/ecma-8/entry.js'), }); new TerserPlugin({ diff --git a/test/test-option.test.js b/test/test-option.test.js index 20d7bcf3..15289dda 100644 --- a/test/test-option.test.js +++ b/test/test-option.test.js @@ -1,3 +1,5 @@ +import path from 'path'; + import TerserPlugin from '../src/index'; import { @@ -15,13 +17,19 @@ describe('test option', () => { beforeEach(() => { compiler = getCompiler({ entry: { - js: `${__dirname}/fixtures/entry.js`, - mjs: `${__dirname}/fixtures/entry.mjs`, - importExport: `${__dirname}/fixtures/import-export/entry.js`, - AsyncImportExport: `${__dirname}/fixtures/async-import-export/entry.js`, + js: path.resolve(__dirname, './fixtures/entry.js'), + mjs: path.resolve(__dirname, './fixtures/entry.mjs'), + importExport: path.resolve( + __dirname, + './fixtures/import-export/entry.js' + ), + AsyncImportExport: path.resolve( + __dirname, + './fixtures/async-import-export/entry.js' + ), }, output: { - path: `${__dirname}/dist`, + path: path.resolve(__dirname, './dist'), filename: `[name].js?var=[${ getCompiler.isWebpack4() ? 'hash' : 'fullhash' }]`, @@ -97,13 +105,19 @@ describe('test option', () => { it('should match snapshot and uglify "mjs"', async () => { compiler = getCompiler({ entry: { - js: `${__dirname}/fixtures/entry.js`, - mjs: `${__dirname}/fixtures/entry.mjs`, - importExport: `${__dirname}/fixtures/import-export/entry.js`, - AsyncImportExport: `${__dirname}/fixtures/async-import-export/entry.js`, + js: path.resolve(__dirname, './fixtures/entry.js'), + mjs: path.resolve(__dirname, './fixtures/entry.mjs'), + importExport: path.resolve( + __dirname, + './fixtures/import-export/entry.js' + ), + AsyncImportExport: path.resolve( + __dirname, + './fixtures/async-import-export/entry.js' + ), }, output: { - path: `${__dirname}/dist`, + path: path.resolve(__dirname, './dist'), filename: `[name].mjs?var=[${ getCompiler.isWebpack4() ? 'hash' : 'fullhash' }]`, diff --git a/test/worker.test.js b/test/worker.test.js index b6247e6d..6ae96ef1 100644 --- a/test/worker.test.js +++ b/test/worker.test.js @@ -5,22 +5,138 @@ import { transform } from '../src/minify'; import getCompiler from './helpers/getCompiler'; describe('worker', () => { - it('should match snapshot when options.extractComments is regex', async () => { + it('should match snapshot when options.extractComments is "false"', async () => { const options = { - file: 'test1.js', - input: 'var foo = 1;/* hello */', + name: 'test1.js', + input: + 'var foo = 1;/* hello */\n// Comment\n/* duplicate */\n/* duplicate */', + extractComments: false, + }; + const workerResult = await transform(serialize(options)); + + expect(workerResult).toMatchSnapshot(); + }); + + it('should match snapshot when options.extractComments is "true"', async () => { + const options = { + name: 'test1.js', + input: + 'var foo = 1;/* hello */\n// Comment\n/* duplicate */\n/* duplicate */', + extractComments: true, + }; + const workerResult = await transform(serialize(options)); + + expect(workerResult).toMatchSnapshot(); + }); + + it('should match snapshot when options.extractComments is RegExp', async () => { + const options = { + name: 'test1.js', + input: + 'var foo = 1;/* hello */\n// Comment\n/* duplicate */\n/* duplicate */', extractComments: /hello/, }; const workerResult = await transform(serialize(options)); - expect(workerResult).toMatchSnapshot(options.file); + expect(workerResult).toMatchSnapshot(); + }); + + it('should match snapshot when options.extractComments is Function', async () => { + const options = { + name: 'test1.js', + input: + 'var foo = 1;/* hello */\n// Comment\n/* duplicate */\n/* duplicate */', + extractComments: () => true, + }; + const workerResult = await transform(serialize(options)); + + expect(workerResult).toMatchSnapshot(); + }); + + it('should match snapshot when options.extractComments is empty Object', async () => { + const options = { + name: 'test1.js', + input: + 'var foo = 1;/* hello */\n// Comment\n/* duplicate */\n/* duplicate */', + extractComments: {}, + }; + const workerResult = await transform(serialize(options)); + + expect(workerResult).toMatchSnapshot(); + }); + + it('should match snapshot when options.extractComments is Object with "true" value', async () => { + const options = { + name: 'test1.js', + input: + 'var foo = 1;/* hello */\n// Comment\n/* duplicate */\n/* duplicate */', + extractComments: { + condition: true, + }, + }; + const workerResult = await transform(serialize(options)); + + expect(workerResult).toMatchSnapshot(); + }); + + it('should match snapshot when options.extractComments is Object with "some" value', async () => { + const options = { + name: 'test1.js', + input: + 'var foo = 1;/* hello */\n// Comment\n/* duplicate */\n/* duplicate */', + extractComments: { + condition: 'some', + }, + }; + const workerResult = await transform(serialize(options)); + + expect(workerResult).toMatchSnapshot(); }); - it('normalizes when terserOptions.output.comments is string: all', async () => { + it('should match snapshot when options.extractComments is Object with "all" value', async () => { const options = { - file: 'test2.js', - input: 'var foo = 1;/* hello */', - terserOptions: { + name: 'test1.js', + input: + 'var foo = 1;/* hello */\n// Comment\n/* duplicate */\n/* duplicate */', + extractComments: { + condition: 'all', + }, + }; + const workerResult = await transform(serialize(options)); + + expect(workerResult).toMatchSnapshot(); + }); + + it('should match snapshot when options.extractComments is "all" value', async () => { + const options = { + name: 'test1.js', + input: + 'var foo = 1;/* hello */\n// Comment\n/* duplicate */\n/* duplicate */', + extractComments: 'all', + }; + const workerResult = await transform(serialize(options)); + + expect(workerResult).toMatchSnapshot(); + }); + + it('should match snapshot when options.extractComments is "some" value', async () => { + const options = { + name: 'test1.js', + input: + 'var foo = 1;/* hello */\n// Comment\n/* duplicate */\n/* duplicate */', + extractComments: 'some', + }; + const workerResult = await transform(serialize(options)); + + expect(workerResult).toMatchSnapshot(); + }); + + it('normalizes when minimizerOptions.output.comments is string: all', async () => { + const options = { + name: 'test2.js', + input: + 'var foo = 1;/* hello */\n// Comment\n/* duplicate */\n/* duplicate */', + minimizerOptions: { output: { comments: 'all', }, @@ -28,14 +144,45 @@ describe('worker', () => { }; const workerResult = await transform(serialize(options)); - expect(workerResult).toMatchSnapshot(options.file); + expect(workerResult).toMatchSnapshot(); + }); + + it('should match snapshot when minimizerOptions.compress.comments is boolean', async () => { + const options = { + name: 'test3.js', + input: + 'var foo = 1;/* hello */\n// Comment\n/* duplicate */\n/* duplicate */', + minimizerOptions: { + compress: true, + }, + }; + const workerResult = await transform(serialize(options)); + + expect(workerResult).toMatchSnapshot(); + }); + + it('should match snapshot when minimizerOptions.compress.comments is object', async () => { + const options = { + name: 'test3.js', + input: + 'var foo = 1;/* hello */\n// Comment\n/* duplicate */\n/* duplicate */', + minimizerOptions: { + compress: { + passes: 2, + }, + }, + }; + const workerResult = await transform(serialize(options)); + + expect(workerResult).toMatchSnapshot(); }); - it('should match snapshot when terserOptions.output.comments is string: some', async () => { + it('should match snapshot when minimizerOptions.output.comments is string: some', async () => { const options = { - file: 'test3.js', - input: 'var foo = 1;/* hello */', - terserOptions: { + name: 'test3.js', + input: + 'var foo = 1;/* hello */\n// Comment\n/* duplicate */\n/* duplicate */', + minimizerOptions: { output: { comments: 'some', }, @@ -43,14 +190,15 @@ describe('worker', () => { }; const workerResult = await transform(serialize(options)); - expect(workerResult).toMatchSnapshot(options.file); + expect(workerResult).toMatchSnapshot(); }); - it('should match snapshot when terserOptions.extractComments is number', async () => { + it('should match snapshot when minimizerOptions.extractComments is number', async () => { const options = { - file: 'test4.js', - input: 'var foo = 1;/* hello */', - terserOptions: { + name: 'test4.js', + input: + 'var foo = 1;/* hello */\n// Comment\n/* duplicate */\n/* duplicate */', + minimizerOptions: { output: { comments: 'some', }, @@ -59,14 +207,14 @@ describe('worker', () => { }; const workerResult = await transform(serialize(options)); - expect(workerResult).toMatchSnapshot(options.file); + expect(workerResult).toMatchSnapshot(); }); it('should match snapshot with extract option set to a single file', async () => { const options = { - file: 'test5.js', + name: 'test5.js', input: '/******/ function hello(a) {console.log(a)}', - terserOptions: { + minimizerOptions: { output: { comments: 'all', }, @@ -83,7 +231,7 @@ describe('worker', () => { }; const workerResult = await transform(serialize(options)); - expect(workerResult).toMatchSnapshot(options.file); + expect(workerResult).toMatchSnapshot(); }); it('should match snapshot with options.inputSourceMap', async () => { @@ -99,6 +247,62 @@ describe('worker', () => { }; const workerResult = await transform(serialize(options)); - expect(workerResult).toMatchSnapshot(options.name); + expect(workerResult).toMatchSnapshot(); + }); + + it('should match snapshot when options.extractComments is "true"', async () => { + const options = { + name: 'test1.js', + input: + 'var foo = 1;/* hello */\n// Comment\n/* duplicate */\n/* duplicate */', + minify: (item) => { + return item['test1.js']; + }, + }; + const workerResult = await transform(serialize(options)); + + expect(workerResult).toMatchSnapshot(); + }); + + it('should match snapshot when minimizerOptions.mangle is "null"', async () => { + const options = { + name: 'test4.js', + input: + 'var foo = 1;/* hello */\n// Comment\n/* duplicate */\n/* duplicate */', + minimizerOptions: { + mangle: null, + }, + }; + const workerResult = await transform(serialize(options)); + + expect(workerResult).toMatchSnapshot(); + }); + + it('should match snapshot when minimizerOptions.mangle is boolean', async () => { + const options = { + name: 'test4.js', + input: + 'var foo = 1;/* hello */\n// Comment\n/* duplicate */\n/* duplicate */', + minimizerOptions: { + mangle: true, + }, + }; + const workerResult = await transform(serialize(options)); + + expect(workerResult).toMatchSnapshot(); + }); + + it('should match snapshot when minimizerOptions.mangle is object', async () => { + const options = { + name: 'test4.js', + input: + 'var foo = 1;/* hello */\n// Comment\n/* duplicate */\n/* duplicate */', + minimizerOptions: { + mangle: { toplevel: true }, + }, + }; + const workerResult = await transform(serialize(options)); + + expect(workerResult).toMatchSnapshot(); }); });