next 15.2.0-canary.54 → 15.2.0-canary.55
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of next might be problematic. Click here for more details.
- package/dist/bin/next +1 -1
- package/dist/build/index.js +2 -2
- package/dist/build/swc/generated-native.d.ts +12 -0
- package/dist/build/swc/index.d.ts +4 -1
- package/dist/build/swc/index.js +1 -1
- package/dist/build/swc/index.js.map +1 -1
- package/dist/build/swc/types.d.ts +6 -0
- package/dist/build/turbopack-build/impl.js +3 -1
- package/dist/build/turbopack-build/impl.js.map +1 -1
- package/dist/build/webpack/plugins/css-minimizer-plugin.d.ts +2 -2
- package/dist/build/webpack/plugins/minify-webpack-plugin/src/index.d.ts +9 -1
- package/dist/build/webpack/plugins/minify-webpack-plugin/src/index.js +27 -33
- package/dist/build/webpack/plugins/minify-webpack-plugin/src/index.js.map +1 -1
- package/dist/build/webpack-config.d.ts +1 -1
- package/dist/build/webpack-config.js +6 -4
- package/dist/build/webpack-config.js.map +1 -1
- package/dist/client/app-bootstrap.js +1 -1
- package/dist/client/index.js +1 -1
- package/dist/esm/build/index.js +2 -2
- package/dist/esm/build/swc/generated-native.d.ts +12 -0
- package/dist/esm/build/swc/index.js +1 -1
- package/dist/esm/build/swc/index.js.map +1 -1
- package/dist/esm/build/swc/types.js.map +1 -1
- package/dist/esm/build/turbopack-build/impl.js +3 -1
- package/dist/esm/build/turbopack-build/impl.js.map +1 -1
- package/dist/esm/build/webpack/plugins/minify-webpack-plugin/src/index.js +28 -34
- package/dist/esm/build/webpack/plugins/minify-webpack-plugin/src/index.js.map +1 -1
- package/dist/esm/build/webpack-config.js +6 -4
- package/dist/esm/build/webpack-config.js.map +1 -1
- package/dist/esm/client/app-bootstrap.js +1 -1
- package/dist/esm/client/index.js +1 -1
- package/dist/esm/server/config.js +1 -1
- package/dist/esm/server/dev/hot-reloader-turbopack.js +3 -2
- package/dist/esm/server/dev/hot-reloader-turbopack.js.map +1 -1
- package/dist/esm/server/dev/hot-reloader-webpack.js +1 -1
- package/dist/esm/server/lib/app-info-log.js +1 -1
- package/dist/esm/server/lib/start-server.js +1 -1
- package/dist/server/config.js +1 -1
- package/dist/server/dev/hot-reloader-turbopack.js +3 -2
- package/dist/server/dev/hot-reloader-turbopack.js.map +1 -1
- package/dist/server/dev/hot-reloader-webpack.js +1 -1
- package/dist/server/lib/app-info-log.js +1 -1
- package/dist/server/lib/start-server.js +1 -1
- package/dist/telemetry/anonymous-meta.js +1 -1
- package/dist/telemetry/events/session-stopped.js +2 -2
- package/dist/telemetry/events/version.js +2 -2
- package/package.json +15 -15
|
@@ -1,33 +1,28 @@
|
|
|
1
|
-
import { webpack, ModuleFilenameHelpers, sources } from 'next/dist/compiled/webpack/webpack';
|
|
1
|
+
import { webpack, ModuleFilenameHelpers, sources, WebpackError } from 'next/dist/compiled/webpack/webpack';
|
|
2
2
|
import pLimit from 'next/dist/compiled/p-limit';
|
|
3
3
|
import { spans } from '../../profiling-plugin';
|
|
4
4
|
function buildError(error, file) {
|
|
5
5
|
if (error.line) {
|
|
6
|
-
return
|
|
7
|
-
value: "E351",
|
|
8
|
-
enumerable: false,
|
|
9
|
-
configurable: true
|
|
10
|
-
});
|
|
6
|
+
return new WebpackError(`${file} from Minifier\n${error.message} [${file}:${error.line},${error.col}]${error.stack ? `\n${error.stack.split('\n').slice(1).join('\n')}` : ''}`);
|
|
11
7
|
}
|
|
12
8
|
if (error.stack) {
|
|
13
|
-
return
|
|
14
|
-
value: "E331",
|
|
15
|
-
enumerable: false,
|
|
16
|
-
configurable: true
|
|
17
|
-
});
|
|
9
|
+
return new WebpackError(`${file} from Minifier\n${error.message}\n${error.stack}`);
|
|
18
10
|
}
|
|
19
|
-
return
|
|
20
|
-
value: "E166",
|
|
21
|
-
enumerable: false,
|
|
22
|
-
configurable: true
|
|
23
|
-
});
|
|
11
|
+
return new WebpackError(`${file} from Minifier\n${error.message}`);
|
|
24
12
|
}
|
|
25
13
|
const debugMinify = process.env.NEXT_DEBUG_MINIFY;
|
|
26
14
|
export class MinifyPlugin {
|
|
15
|
+
constructor(options){
|
|
16
|
+
this.options = options;
|
|
17
|
+
}
|
|
27
18
|
async optimize(compiler, compilation, assets, cache, { SourceMapSource, RawSource }) {
|
|
19
|
+
const mangle = !this.options.noMangling;
|
|
28
20
|
const compilationSpan = spans.get(compilation) || spans.get(compiler);
|
|
29
21
|
const MinifierSpan = compilationSpan.traceChild('minify-webpack-plugin-optimize');
|
|
30
|
-
|
|
22
|
+
if (compilation.name) {
|
|
23
|
+
MinifierSpan.setAttribute('compilationName', compilation.name);
|
|
24
|
+
}
|
|
25
|
+
MinifierSpan.setAttribute('mangle', String(mangle));
|
|
31
26
|
return MinifierSpan.traceAsyncFn(async ()=>{
|
|
32
27
|
const assetsList = Object.keys(assets);
|
|
33
28
|
const assetsForMinify = await Promise.all(assetsList.filter((name)=>{
|
|
@@ -50,7 +45,7 @@ export class MinifyPlugin {
|
|
|
50
45
|
return true;
|
|
51
46
|
}).map(async (name)=>{
|
|
52
47
|
const { info, source } = compilation.getAsset(name);
|
|
53
|
-
const eTag = cache.getLazyHashedEtag(source);
|
|
48
|
+
const eTag = cache.mergeEtags(cache.getLazyHashedEtag(source), JSON.stringify(this.options));
|
|
54
49
|
const output = await cache.getPromise(name, eTag);
|
|
55
50
|
if (debugMinify && debugMinify === '1') {
|
|
56
51
|
console.log(JSON.stringify({
|
|
@@ -80,8 +75,10 @@ export class MinifyPlugin {
|
|
|
80
75
|
content: JSON.stringify(options.inputSourceMap)
|
|
81
76
|
}
|
|
82
77
|
} : {},
|
|
83
|
-
|
|
84
|
-
|
|
78
|
+
// Compress options are defined in crates/napi/src/minify.rs.
|
|
79
|
+
compress: false,
|
|
80
|
+
// Mangle options may be amended in crates/napi/src/minify.rs.
|
|
81
|
+
mangle,
|
|
85
82
|
module: 'unknown',
|
|
86
83
|
output: {
|
|
87
84
|
comments: false
|
|
@@ -105,31 +102,28 @@ export class MinifyPlugin {
|
|
|
105
102
|
if (!output) {
|
|
106
103
|
const { source: sourceFromInputSource, map: inputSourceMap } = inputSource.sourceAndMap();
|
|
107
104
|
const input = Buffer.isBuffer(sourceFromInputSource) ? sourceFromInputSource.toString() : sourceFromInputSource;
|
|
108
|
-
|
|
109
|
-
name,
|
|
110
|
-
input,
|
|
111
|
-
inputSourceMap
|
|
112
|
-
};
|
|
105
|
+
let minifiedOutput;
|
|
113
106
|
try {
|
|
114
|
-
|
|
107
|
+
minifiedOutput = await getWorker().minify({
|
|
108
|
+
input,
|
|
109
|
+
inputSourceMap
|
|
110
|
+
});
|
|
115
111
|
} catch (error) {
|
|
116
112
|
compilation.errors.push(buildError(error, name));
|
|
117
113
|
return;
|
|
118
114
|
}
|
|
119
|
-
|
|
120
|
-
output.source = new SourceMapSource(output.code, name, output.map, input, inputSourceMap, true);
|
|
121
|
-
} else {
|
|
122
|
-
output.source = new RawSource(output.code);
|
|
123
|
-
}
|
|
115
|
+
const source = minifiedOutput.map ? new SourceMapSource(minifiedOutput.code, name, minifiedOutput.map, input, inputSourceMap, true) : new RawSource(minifiedOutput.code);
|
|
124
116
|
await cache.storePromise(name, eTag, {
|
|
125
|
-
source
|
|
117
|
+
source
|
|
126
118
|
});
|
|
119
|
+
output = {
|
|
120
|
+
source
|
|
121
|
+
};
|
|
127
122
|
}
|
|
128
123
|
const newInfo = {
|
|
129
124
|
minimized: true
|
|
130
125
|
};
|
|
131
|
-
|
|
132
|
-
compilation.updateAsset(name, source, newInfo);
|
|
126
|
+
compilation.updateAsset(name, output.source, newInfo);
|
|
133
127
|
});
|
|
134
128
|
}));
|
|
135
129
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../../src/build/webpack/plugins/minify-webpack-plugin/src/index.ts"],"sourcesContent":["import {\n webpack,\n ModuleFilenameHelpers,\n sources,\n} from 'next/dist/compiled/webpack/webpack'\nimport pLimit from 'next/dist/compiled/p-limit'\nimport { spans } from '../../profiling-plugin'\n\nfunction buildError(error: any, file: string) {\n if (error.line) {\n return new Error(\n `${file} from Minifier\\n${error.message} [${file}:${error.line},${\n error.col\n }]${\n error.stack ? `\\n${error.stack.split('\\n').slice(1).join('\\n')}` : ''\n }`\n )\n }\n\n if (error.stack) {\n return new Error(`${file} from Minifier\\n${error.message}\\n${error.stack}`)\n }\n\n return new Error(`${file} from Minifier\\n${error.message}`)\n}\n\nconst debugMinify = process.env.NEXT_DEBUG_MINIFY\n\nexport class MinifyPlugin {\n async optimize(\n compiler: any,\n compilation: any,\n assets: any,\n cache: any,\n { SourceMapSource, RawSource }: any\n ) {\n const compilationSpan = spans.get(compilation)! || spans.get(compiler)\n const MinifierSpan = compilationSpan.traceChild(\n 'minify-webpack-plugin-optimize'\n )\n MinifierSpan.setAttribute('compilationName', compilation.name)\n\n return MinifierSpan.traceAsyncFn(async () => {\n const assetsList = Object.keys(assets)\n\n const assetsForMinify = await Promise.all(\n assetsList\n .filter((name) => {\n if (\n !ModuleFilenameHelpers.matchObject.bind(\n // eslint-disable-next-line no-undefined\n undefined,\n { test: /\\.[cm]?js(\\?.*)?$/i }\n )(name)\n ) {\n return false\n }\n\n const res = compilation.getAsset(name)\n if (!res) {\n console.log(name)\n return false\n }\n\n const { info } = res\n\n // Skip double minimize assets from child compilation\n if (info.minimized) {\n return false\n }\n\n return true\n })\n .map(async (name) => {\n const { info, source } = compilation.getAsset(name)\n\n const eTag = cache.getLazyHashedEtag(source)\n const output = await cache.getPromise(name, eTag)\n\n if (debugMinify && debugMinify === '1') {\n console.log(\n JSON.stringify({\n name,\n source: source.source().toString(),\n }),\n {\n breakLength: Infinity,\n maxStringLength: Infinity,\n }\n )\n }\n return { name, info, inputSource: source, output, eTag }\n })\n )\n\n let initializedWorker: any\n\n // eslint-disable-next-line consistent-return\n const getWorker = () => {\n return {\n minify: async (options: any) => {\n const result = await require('../../../../swc').minify(\n options.input,\n {\n ...(options.inputSourceMap\n ? {\n sourceMap: {\n content: JSON.stringify(options.inputSourceMap),\n },\n }\n : {}),\n compress: true,\n mangle: true,\n module: 'unknown',\n output: {\n comments: false,\n },\n }\n )\n\n return result\n },\n }\n }\n\n // The limit in the SWC minifier will be handled by Node.js\n const limit = pLimit(Infinity)\n const scheduledTasks = []\n\n for (const asset of assetsForMinify) {\n scheduledTasks.push(\n limit(async () => {\n const { name, inputSource, eTag } = asset\n let { output } = asset\n\n const minifySpan = MinifierSpan.traceChild('minify-js')\n minifySpan.setAttribute('name', name)\n minifySpan.setAttribute(\n 'cache',\n typeof output === 'undefined' ? 'MISS' : 'HIT'\n )\n\n return minifySpan.traceAsyncFn(async () => {\n if (!output) {\n const { source: sourceFromInputSource, map: inputSourceMap } =\n inputSource.sourceAndMap()\n\n const input = Buffer.isBuffer(sourceFromInputSource)\n ? sourceFromInputSource.toString()\n : sourceFromInputSource\n\n const options = {\n name,\n input,\n inputSourceMap,\n }\n\n try {\n output = await getWorker().minify(options)\n } catch (error) {\n compilation.errors.push(buildError(error, name))\n\n return\n }\n\n if (output.map) {\n output.source = new SourceMapSource(\n output.code,\n name,\n output.map,\n input,\n inputSourceMap,\n true\n )\n } else {\n output.source = new RawSource(output.code)\n }\n\n await cache.storePromise(name, eTag, {\n source: output.source,\n })\n }\n\n const newInfo = { minimized: true }\n const { source } = output\n\n compilation.updateAsset(name, source, newInfo)\n })\n })\n )\n }\n\n await Promise.all(scheduledTasks)\n\n if (initializedWorker) {\n await initializedWorker.end()\n }\n })\n }\n\n apply(compiler: any) {\n const { SourceMapSource, RawSource } = compiler?.webpack?.sources || sources\n const pluginName = this.constructor.name\n\n compiler.hooks.thisCompilation.tap(pluginName, (compilation: any) => {\n const cache = compilation.getCache('MinifierWebpackPlugin')\n\n const handleHashForChunk = (hash: any, _chunk: any) => {\n // increment 'c' to invalidate cache\n hash.update('c')\n }\n\n const JSModulesHooks =\n webpack.javascript.JavascriptModulesPlugin.getCompilationHooks(\n compilation\n )\n JSModulesHooks.chunkHash.tap(pluginName, (chunk, hash) => {\n if (!chunk.hasRuntime()) return\n return handleHashForChunk(hash, chunk)\n })\n\n compilation.hooks.processAssets.tapPromise(\n {\n name: pluginName,\n stage: webpack.Compilation.PROCESS_ASSETS_STAGE_OPTIMIZE_SIZE,\n },\n (assets: any) =>\n this.optimize(compiler, compilation, assets, cache, {\n SourceMapSource,\n RawSource,\n })\n )\n\n compilation.hooks.statsPrinter.tap(pluginName, (stats: any) => {\n stats.hooks.print\n .for('asset.info.minimized')\n .tap(\n 'minify-webpack-plugin',\n (minimized: any, { green, formatFlag }: any) =>\n // eslint-disable-next-line no-undefined\n minimized ? green(formatFlag('minimized')) : undefined\n )\n })\n })\n }\n}\n"],"names":["webpack","ModuleFilenameHelpers","sources","pLimit","spans","buildError","error","file","line","Error","message","col","stack","split","slice","join","debugMinify","process","env","NEXT_DEBUG_MINIFY","MinifyPlugin","optimize","compiler","compilation","assets","cache","SourceMapSource","RawSource","compilationSpan","get","MinifierSpan","traceChild","setAttribute","name","traceAsyncFn","assetsList","Object","keys","assetsForMinify","Promise","all","filter","matchObject","bind","undefined","test","res","getAsset","console","log","info","minimized","map","source","eTag","getLazyHashedEtag","output","getPromise","JSON","stringify","toString","breakLength","Infinity","maxStringLength","inputSource","initializedWorker","getWorker","minify","options","result","require","input","inputSourceMap","sourceMap","content","compress","mangle","module","comments","limit","scheduledTasks","asset","push","minifySpan","sourceFromInputSource","sourceAndMap","Buffer","isBuffer","errors","code","storePromise","newInfo","updateAsset","end","apply","pluginName","constructor","hooks","thisCompilation","tap","getCache","handleHashForChunk","hash","_chunk","update","JSModulesHooks","javascript","JavascriptModulesPlugin","getCompilationHooks","chunkHash","chunk","hasRuntime","processAssets","tapPromise","stage","Compilation","PROCESS_ASSETS_STAGE_OPTIMIZE_SIZE","statsPrinter","stats","print","for","green","formatFlag"],"mappings":"AAAA,SACEA,OAAO,EACPC,qBAAqB,EACrBC,OAAO,QACF,qCAAoC;AAC3C,OAAOC,YAAY,6BAA4B;AAC/C,SAASC,KAAK,QAAQ,y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D,WAAgB,EAAEsE,KAAK,EAAEC,UAAU,EAAO,GACzC,wCAAwC;oBACxCvE,YAAYsE,MAAMC,WAAW,gBAAgB9E;YAErD;QACF;IACF;AACF"}
|
|
1
|
+
{"version":3,"sources":["../../../../../../src/build/webpack/plugins/minify-webpack-plugin/src/index.ts"],"sourcesContent":["import {\n webpack,\n ModuleFilenameHelpers,\n sources,\n WebpackError,\n type CacheFacade,\n type Compilation,\n} from 'next/dist/compiled/webpack/webpack'\nimport pLimit from 'next/dist/compiled/p-limit'\nimport { spans } from '../../profiling-plugin'\n\nfunction buildError(error: any, file: string) {\n if (error.line) {\n return new WebpackError(\n `${file} from Minifier\\n${error.message} [${file}:${error.line},${\n error.col\n }]${\n error.stack ? `\\n${error.stack.split('\\n').slice(1).join('\\n')}` : ''\n }`\n )\n }\n\n if (error.stack) {\n return new WebpackError(\n `${file} from Minifier\\n${error.message}\\n${error.stack}`\n )\n }\n\n return new WebpackError(`${file} from Minifier\\n${error.message}`)\n}\n\nconst debugMinify = process.env.NEXT_DEBUG_MINIFY\n\nexport class MinifyPlugin {\n constructor(private options: { noMangling?: boolean }) {}\n\n async optimize(\n compiler: any,\n compilation: Compilation,\n assets: any,\n cache: CacheFacade,\n {\n SourceMapSource,\n RawSource,\n }: {\n SourceMapSource: typeof sources.SourceMapSource\n RawSource: typeof sources.RawSource\n }\n ) {\n const mangle = !this.options.noMangling\n const compilationSpan = spans.get(compilation)! || spans.get(compiler)\n\n const MinifierSpan = compilationSpan.traceChild(\n 'minify-webpack-plugin-optimize'\n )\n\n if (compilation.name) {\n MinifierSpan.setAttribute('compilationName', compilation.name)\n }\n\n MinifierSpan.setAttribute('mangle', String(mangle))\n\n return MinifierSpan.traceAsyncFn(async () => {\n const assetsList = Object.keys(assets)\n\n const assetsForMinify = await Promise.all(\n assetsList\n .filter((name) => {\n if (\n !ModuleFilenameHelpers.matchObject.bind(\n // eslint-disable-next-line no-undefined\n undefined,\n { test: /\\.[cm]?js(\\?.*)?$/i }\n )(name)\n ) {\n return false\n }\n\n const res = compilation.getAsset(name)\n if (!res) {\n console.log(name)\n return false\n }\n\n const { info } = res\n\n // Skip double minimize assets from child compilation\n if (info.minimized) {\n return false\n }\n\n return true\n })\n .map(async (name) => {\n const { info, source } = compilation.getAsset(name)!\n\n const eTag = cache.mergeEtags(\n cache.getLazyHashedEtag(source),\n JSON.stringify(this.options)\n )\n\n const output = await cache.getPromise<\n { source: sources.Source } | undefined\n >(name, eTag)\n\n if (debugMinify && debugMinify === '1') {\n console.log(\n JSON.stringify({ name, source: source.source().toString() }),\n { breakLength: Infinity, maxStringLength: Infinity }\n )\n }\n return { name, info, inputSource: source, output, eTag }\n })\n )\n\n let initializedWorker: any\n\n // eslint-disable-next-line consistent-return\n const getWorker = () => {\n return {\n minify: async (options: {\n input: string\n inputSourceMap: Object\n }) => {\n const result = await (\n require('../../../../swc') as typeof import('../../../../swc')\n ).minify(options.input, {\n ...(options.inputSourceMap\n ? {\n sourceMap: {\n content: JSON.stringify(options.inputSourceMap),\n },\n }\n : {}),\n // Compress options are defined in crates/napi/src/minify.rs.\n compress: false,\n // Mangle options may be amended in crates/napi/src/minify.rs.\n mangle,\n module: 'unknown',\n output: {\n comments: false,\n },\n })\n\n return result\n },\n }\n }\n\n // The limit in the SWC minifier will be handled by Node.js\n const limit = pLimit(Infinity)\n const scheduledTasks = []\n\n for (const asset of assetsForMinify) {\n scheduledTasks.push(\n limit(async () => {\n const { name, inputSource, eTag } = asset\n let { output } = asset\n\n const minifySpan = MinifierSpan.traceChild('minify-js')\n minifySpan.setAttribute('name', name)\n minifySpan.setAttribute(\n 'cache',\n typeof output === 'undefined' ? 'MISS' : 'HIT'\n )\n\n return minifySpan.traceAsyncFn(async () => {\n if (!output) {\n const { source: sourceFromInputSource, map: inputSourceMap } =\n inputSource.sourceAndMap()\n\n const input = Buffer.isBuffer(sourceFromInputSource)\n ? sourceFromInputSource.toString()\n : sourceFromInputSource\n\n let minifiedOutput: { code: string; map: any } | undefined\n\n try {\n minifiedOutput = await getWorker().minify({\n input,\n inputSourceMap,\n })\n } catch (error) {\n compilation.errors.push(buildError(error, name))\n\n return\n }\n\n const source = minifiedOutput.map\n ? new SourceMapSource(\n minifiedOutput.code,\n name,\n minifiedOutput.map,\n input,\n inputSourceMap,\n true\n )\n : new RawSource(minifiedOutput.code)\n\n await cache.storePromise(name, eTag, { source })\n\n output = { source }\n }\n\n const newInfo = { minimized: true }\n\n compilation.updateAsset(name, output.source, newInfo)\n })\n })\n )\n }\n\n await Promise.all(scheduledTasks)\n\n if (initializedWorker) {\n await initializedWorker.end()\n }\n })\n }\n\n apply(compiler: any) {\n const { SourceMapSource, RawSource } = (compiler?.webpack?.sources ||\n sources) as typeof sources\n\n const pluginName = this.constructor.name\n\n compiler.hooks.thisCompilation.tap(\n pluginName,\n (compilation: Compilation) => {\n const cache = compilation.getCache('MinifierWebpackPlugin')\n\n const handleHashForChunk = (hash: any, _chunk: any) => {\n // increment 'c' to invalidate cache\n hash.update('c')\n }\n\n const JSModulesHooks =\n webpack.javascript.JavascriptModulesPlugin.getCompilationHooks(\n compilation\n )\n JSModulesHooks.chunkHash.tap(pluginName, (chunk, hash) => {\n if (!chunk.hasRuntime()) return\n return handleHashForChunk(hash, chunk)\n })\n\n compilation.hooks.processAssets.tapPromise(\n {\n name: pluginName,\n stage: webpack.Compilation.PROCESS_ASSETS_STAGE_OPTIMIZE_SIZE,\n },\n (assets: any) =>\n this.optimize(compiler, compilation, assets, cache, {\n SourceMapSource,\n RawSource,\n })\n )\n\n compilation.hooks.statsPrinter.tap(pluginName, (stats: any) => {\n stats.hooks.print\n .for('asset.info.minimized')\n .tap(\n 'minify-webpack-plugin',\n (minimized: any, { green, formatFlag }: any) =>\n // eslint-disable-next-line no-undefined\n minimized ? green(formatFlag('minimized')) : undefined\n )\n })\n }\n )\n }\n}\n"],"names":["webpack","ModuleFilenameHelpers","sources","WebpackError","pLimit","spans","buildError","error","file","line","message","col","stack","split","slice","join","debugMinify","process","env","NEXT_DEBUG_MINIFY","MinifyPlugin","constructor","options","optimize","compiler","compilation","assets","cache","SourceMapSource","RawSource","mangle","noMangling","compilationSpan","get","MinifierSpan","traceChild","name","setAttribute","String","traceAsyncFn","assetsList","Object","keys","assetsForMinify","Promise","all","filter","matchObject","bind","undefined","test","res","getAsset","console","log","info","minimized","map","source","eTag","mergeEtags","getLazyHashedEtag","JSON","stringify","output","getPromise","toString","breakLength","Infinity","maxStringLength","inputSource","initializedWorker","getWorker","minify","result","require","input","inputSourceMap","sourceMap","content","compress","module","comments","limit","scheduledTasks","asset","push","minifySpan","sourceFromInputSource","sourceAndMap","Buffer","isBuffer","minifiedOutput","errors","code","storePromise","newInfo","updateAsset","end","apply","pluginName","hooks","thisCompilation","tap","getCache","handleHashForChunk","hash","_chunk","update","JSModulesHooks","javascript","JavascriptModulesPlugin","getCompilationHooks","chunkHash","chunk","hasRuntime","processAssets","tapPromise","stage","Compilation","PROCESS_ASSETS_STAGE_OPTIMIZE_SIZE","statsPrinter","stats","print","for","green","formatFlag"],"mappings":"AAAA,SACEA,OAAO,EACPC,qBAAqB,EACrBC,OAAO,EACPC,YAAY,QAGP,qCAAoC;AAC3C,OAAOC,YAAY,6BAA4B;AAC/C,SAASC,KAAK,QAAQ,yBAAwB;AAE9C,SAASC,WAAWC,KAAU,EAAEC,IAAY;IAC1C,IAAID,MAAME,IAAI,EAAE;QACd,OAAO,IAAIN,aACT,GAAGK,KAAK,gBAAgB,EAAED,MAAMG,OAAO,CAAC,EAAE,EAAEF,KAAK,CAAC,EAAED,MAAME,IAAI,CAAC,CAAC,EAC9DF,MAAMI,GAAG,CACV,CAAC,EACAJ,MAAMK,KAAK,GAAG,CAAC,EAAE,EAAEL,MAAMK,KAAK,CAACC,KAAK,CAAC,MAAMC,KAAK,CAAC,GAAGC,IAAI,CAAC,OAAO,GAAG,IACnE;IAEN;IAEA,IAAIR,MAAMK,KAAK,EAAE;QACf,OAAO,IAAIT,aACT,GAAGK,KAAK,gBAAgB,E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AChEA;QAEF,MAAMkG,aAAa,IAAI,CAAC/E,WAAW,CAACe,IAAI;QAExCZ,SAAS6E,KAAK,CAACC,eAAe,CAACC,GAAG,CAChCH,YACA,CAAC3E;YACC,MAAME,QAAQF,YAAY+E,QAAQ,CAAC;YAEnC,MAAMC,qBAAqB,CAACC,MAAWC;gBACrC,oCAAoC;gBACpCD,KAAKE,MAAM,CAAC;YACd;YAEA,MAAMC,iBACJ7G,QAAQ8G,UAAU,CAACC,uBAAuB,CAACC,mBAAmB,CAC5DvF;YAEJoF,eAAeI,SAAS,CAACV,GAAG,CAACH,YAAY,CAACc,OAAOR;gBAC/C,IAAI,CAACQ,MAAMC,UAAU,IAAI;gBACzB,OAAOV,mBAAmBC,MAAMQ;YAClC;YAEAzF,YAAY4E,KAAK,CAACe,aAAa,CAACC,UAAU,CACxC;gBACEjF,MAAMgE;gBACNkB,OAAOtH,QAAQuH,WAAW,CAACC,kCAAkC;YAC/D,GACA,CAAC9F,SACC,IAAI,CAACH,QAAQ,CAACC,UAAUC,aAAaC,QAAQC,OAAO;oBAClDC;oBACAC;gBACF;YAGJJ,YAAY4E,KAAK,CAACoB,YAAY,CAAClB,GAAG,CAACH,YAAY,CAACsB;gBAC9CA,MAAMrB,KAAK,CAACsB,KAAK,CACdC,GAAG,CAAC,wBACJrB,GAAG,CACF,yBACA,CAAC/C,WAAgB,EAAEqE,KAAK,EAAEC,UAAU,EAAO,GACzC,wCAAwC;oBACxCtE,YAAYqE,MAAMC,WAAW,gBAAgB7E;YAErD;QACF;IAEJ;AACF"}
|
|
@@ -189,7 +189,7 @@ export function hasExternalOtelApiPackage() {
|
|
|
189
189
|
}
|
|
190
190
|
}
|
|
191
191
|
const UNSAFE_CACHE_REGEX = /[\\/]pages[\\/][^\\/]+(?:$|\?|#)/;
|
|
192
|
-
export default async function getBaseWebpackConfig(dir, { buildId, encryptionKey, config, compilerType, dev = false, entrypoints, isDevFallback = false, pagesDir, reactProductionProfiling = false, rewrites, originalRewrites, originalRedirects, runWebpackSpan, appDir, middlewareMatchers, jsConfig, jsConfigPath, resolvedBaseUrl, supportedBrowsers, clientRouterFilters, fetchCacheKeyPrefix, edgePreviewProps }) {
|
|
192
|
+
export default async function getBaseWebpackConfig(dir, { buildId, encryptionKey, config, compilerType, dev = false, entrypoints, isDevFallback = false, pagesDir, reactProductionProfiling = false, rewrites, originalRewrites, originalRedirects, runWebpackSpan, appDir, middlewareMatchers, noMangling, jsConfig, jsConfigPath, resolvedBaseUrl, supportedBrowsers, clientRouterFilters, fetchCacheKeyPrefix, edgePreviewProps }) {
|
|
193
193
|
var _config_experimental, _config_experimental1, _config_watchOptions, _config_experimental_sri, _config_experimental_sri1, _config_compiler, _config_compiler1, _config_compiler2, _jsConfig_compilerOptions, _config_compiler3, _jsConfig_compilerOptions1, _config_compiler4, _jsConfig_compilerOptions2, // always add JsConfigPathsPlugin to allow hot-reloading
|
|
194
194
|
// if the config is added/removed
|
|
195
195
|
_webpackConfig_resolve_plugins, _webpackConfig_resolve, _config_experimental2, _config_compiler5, _config_compiler6, _config_compiler7, _config_compiler8, _config_compiler9, _webpack5Config_plugins, _webpackConfig_module, _webpackConfig_module1, _webpackConfig_module_rules, _webpackConfig_module2;
|
|
@@ -734,7 +734,9 @@ export default async function getBaseWebpackConfig(dir, { buildId, encryptionKey
|
|
|
734
734
|
(compiler)=>{
|
|
735
735
|
// @ts-ignore No typings yet
|
|
736
736
|
const { MinifyPlugin } = require('./webpack/plugins/minify-webpack-plugin/src/index.js');
|
|
737
|
-
new MinifyPlugin(
|
|
737
|
+
new MinifyPlugin({
|
|
738
|
+
noMangling
|
|
739
|
+
}).apply(compiler);
|
|
738
740
|
},
|
|
739
741
|
// Minify CSS
|
|
740
742
|
(compiler)=>{
|
|
@@ -1435,7 +1437,7 @@ export default async function getBaseWebpackConfig(dir, { buildId, encryptionKey
|
|
|
1435
1437
|
isClient && new CopyFilePlugin({
|
|
1436
1438
|
// file path to build output of `@next/polyfill-nomodule`
|
|
1437
1439
|
filePath: require.resolve('./polyfills/polyfill-nomodule'),
|
|
1438
|
-
cacheKey: "15.2.0-canary.
|
|
1440
|
+
cacheKey: "15.2.0-canary.55",
|
|
1439
1441
|
name: `static/chunks/polyfills${dev ? '' : '-[hash]'}.js`,
|
|
1440
1442
|
minimize: false,
|
|
1441
1443
|
info: {
|
|
@@ -1668,7 +1670,7 @@ export default async function getBaseWebpackConfig(dir, { buildId, encryptionKey
|
|
|
1668
1670
|
// - Next.js location on disk (some loaders use absolute paths and some resolve options depend on absolute paths)
|
|
1669
1671
|
// - Next.js version
|
|
1670
1672
|
// - next.config.js keys that affect compilation
|
|
1671
|
-
version: `${__dirname}|${"15.2.0-canary.
|
|
1673
|
+
version: `${__dirname}|${"15.2.0-canary.55"}|${configVars}`,
|
|
1672
1674
|
cacheDirectory: path.join(distDir, 'cache', 'webpack'),
|
|
1673
1675
|
// For production builds, it's more efficient to compress all cache files together instead of compression each one individually.
|
|
1674
1676
|
// So we disable compression here and allow the build runner to take care of compressing the cache as a whole.
|