next 15.6.0-canary.50 → 15.6.0-canary.52
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin/next +1 -1
- package/dist/build/adapter/build-complete.d.ts +12 -1
- package/dist/build/adapter/build-complete.js +80 -21
- package/dist/build/adapter/build-complete.js.map +1 -1
- package/dist/build/index.js +31 -27
- package/dist/build/index.js.map +1 -1
- package/dist/build/swc/index.js +1 -1
- package/dist/build/type-check.js +15 -8
- package/dist/build/type-check.js.map +1 -1
- package/dist/build/webpack/config/blocks/css/index.js +1 -15
- package/dist/build/webpack/config/blocks/css/index.js.map +1 -1
- package/dist/build/webpack-config.js +2 -2
- package/dist/client/app-bootstrap.js +1 -1
- package/dist/client/index.js +1 -1
- package/dist/compiled/next-server/pages-api-turbo.runtime.dev.js +1 -1
- package/dist/compiled/next-server/pages-api-turbo.runtime.dev.js.map +1 -1
- package/dist/compiled/next-server/pages-api-turbo.runtime.prod.js +1 -1
- package/dist/compiled/next-server/pages-api-turbo.runtime.prod.js.map +1 -1
- package/dist/compiled/next-server/pages-api.runtime.prod.js +1 -1
- package/dist/compiled/next-server/pages-api.runtime.prod.js.map +1 -1
- package/dist/compiled/next-server/pages-turbo.runtime.dev.js +1 -1
- package/dist/compiled/next-server/pages-turbo.runtime.dev.js.map +1 -1
- package/dist/compiled/next-server/pages-turbo.runtime.prod.js +1 -1
- package/dist/compiled/next-server/pages-turbo.runtime.prod.js.map +1 -1
- package/dist/compiled/next-server/pages.runtime.prod.js +1 -1
- package/dist/compiled/next-server/pages.runtime.prod.js.map +1 -1
- package/dist/compiled/sass-loader/cjs.js +1 -1
- package/dist/esm/build/adapter/build-complete.js +80 -21
- package/dist/esm/build/adapter/build-complete.js.map +1 -1
- package/dist/esm/build/index.js +31 -27
- package/dist/esm/build/index.js.map +1 -1
- package/dist/esm/build/swc/index.js +1 -1
- package/dist/esm/build/type-check.js +15 -8
- package/dist/esm/build/type-check.js.map +1 -1
- package/dist/esm/build/webpack/config/blocks/css/index.js +1 -15
- package/dist/esm/build/webpack/config/blocks/css/index.js.map +1 -1
- package/dist/esm/build/webpack-config.js +2 -2
- package/dist/esm/client/app-bootstrap.js +1 -1
- package/dist/esm/client/index.js +1 -1
- package/dist/esm/lib/recursive-delete.js +1 -1
- package/dist/esm/lib/recursive-delete.js.map +1 -1
- package/dist/esm/server/dev/hot-reloader-turbopack.js +8 -2
- package/dist/esm/server/dev/hot-reloader-turbopack.js.map +1 -1
- package/dist/esm/server/dev/hot-reloader-webpack.js +10 -4
- package/dist/esm/server/dev/hot-reloader-webpack.js.map +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/esm/server/mcp/get-mcp-middleware.js +2 -2
- package/dist/esm/server/mcp/get-mcp-middleware.js.map +1 -1
- package/dist/esm/server/mcp/get-or-create-mcp-server.js +7 -7
- package/dist/esm/server/mcp/get-or-create-mcp-server.js.map +1 -1
- package/dist/esm/server/mcp/tools/{get-project-path.js → get-project-metadata.js} +9 -5
- package/dist/esm/server/mcp/tools/get-project-metadata.js.map +1 -0
- package/dist/esm/shared/lib/canary-only.js +1 -1
- package/dist/lib/recursive-delete.d.ts +1 -1
- package/dist/lib/recursive-delete.js +1 -1
- package/dist/lib/recursive-delete.js.map +1 -1
- package/dist/server/dev/hot-reloader-turbopack.js +8 -2
- package/dist/server/dev/hot-reloader-turbopack.js.map +1 -1
- package/dist/server/dev/hot-reloader-webpack.js +10 -4
- package/dist/server/dev/hot-reloader-webpack.js.map +1 -1
- package/dist/server/lib/app-info-log.js +1 -1
- package/dist/server/lib/start-server.js +1 -1
- package/dist/server/mcp/get-mcp-middleware.d.ts +2 -2
- package/dist/server/mcp/get-mcp-middleware.js +2 -2
- package/dist/server/mcp/get-mcp-middleware.js.map +1 -1
- package/dist/server/mcp/get-or-create-mcp-server.d.ts +8 -1
- package/dist/server/mcp/get-or-create-mcp-server.js +7 -7
- package/dist/server/mcp/get-or-create-mcp-server.js.map +1 -1
- package/dist/server/mcp/tools/get-project-metadata.d.ts +2 -0
- package/dist/server/mcp/tools/{get-project-path.js → get-project-metadata.js} +11 -7
- package/dist/server/mcp/tools/get-project-metadata.js.map +1 -0
- package/dist/shared/lib/canary-only.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 +16 -16
- package/dist/esm/server/mcp/tools/get-project-path.js.map +0 -1
- package/dist/server/mcp/tools/get-project-path.d.ts +0 -2
- package/dist/server/mcp/tools/get-project-path.js.map +0 -1
package/dist/build/swc/index.js
CHANGED
|
@@ -130,7 +130,7 @@ function _interop_require_wildcard(obj, nodeInterop) {
|
|
|
130
130
|
}
|
|
131
131
|
return newObj;
|
|
132
132
|
}
|
|
133
|
-
const nextVersion = "15.6.0-canary.
|
|
133
|
+
const nextVersion = "15.6.0-canary.52";
|
|
134
134
|
const ArchName = (0, _os.arch)();
|
|
135
135
|
const PlatformName = (0, _os.platform)();
|
|
136
136
|
function infoLog(...args) {
|
package/dist/build/type-check.js
CHANGED
|
@@ -112,25 +112,25 @@ async function startTypeChecking({ cacheDir, config, dir, ignoreESLint, nextBuil
|
|
|
112
112
|
let typeCheckingAndLintingSpinnerPrefixText;
|
|
113
113
|
let typeCheckingAndLintingSpinner;
|
|
114
114
|
if (!ignoreTypeScriptErrors && shouldLint) {
|
|
115
|
-
typeCheckingAndLintingSpinnerPrefixText = '
|
|
115
|
+
typeCheckingAndLintingSpinnerPrefixText = 'Running ESLint and TypeScript concurrently';
|
|
116
116
|
} else if (!ignoreTypeScriptErrors) {
|
|
117
|
-
typeCheckingAndLintingSpinnerPrefixText = '
|
|
117
|
+
typeCheckingAndLintingSpinnerPrefixText = 'Running TypeScript';
|
|
118
118
|
} else if (shouldLint) {
|
|
119
|
-
typeCheckingAndLintingSpinnerPrefixText = '
|
|
119
|
+
typeCheckingAndLintingSpinnerPrefixText = 'Running ESLint';
|
|
120
120
|
}
|
|
121
121
|
// we will not create a spinner if both ignoreTypeScriptErrors and ignoreESLint are
|
|
122
122
|
// enabled, but we will still verifying project's tsconfig and dependencies.
|
|
123
123
|
if (typeCheckingAndLintingSpinnerPrefixText) {
|
|
124
124
|
typeCheckingAndLintingSpinner = (0, _spinner.default)(typeCheckingAndLintingSpinnerPrefixText);
|
|
125
125
|
}
|
|
126
|
-
const
|
|
126
|
+
const typeCheckAndLintStart = process.hrtime();
|
|
127
127
|
try {
|
|
128
|
-
const [[verifyResult, typeCheckEnd]] = await Promise.all([
|
|
128
|
+
const [[verifyResult, typeCheckEnd], lintCheckEnd] = await Promise.all([
|
|
129
129
|
nextBuildSpan.traceChild('run-typescript').traceAsyncFn(()=>verifyTypeScriptSetup(dir, config.distDir, [
|
|
130
130
|
pagesDir,
|
|
131
131
|
appDir
|
|
132
132
|
].filter(Boolean), !ignoreTypeScriptErrors, config.typescript.tsconfigPath, config.images.disableStaticImages, cacheDir, config.experimental.workerThreads, !!appDir, !!pagesDir).then((resolved)=>{
|
|
133
|
-
const checkEnd = process.hrtime(
|
|
133
|
+
const checkEnd = process.hrtime(typeCheckAndLintStart);
|
|
134
134
|
return [
|
|
135
135
|
resolved,
|
|
136
136
|
checkEnd
|
|
@@ -139,11 +139,18 @@ async function startTypeChecking({ cacheDir, config, dir, ignoreESLint, nextBuil
|
|
|
139
139
|
shouldLint && nextBuildSpan.traceChild('run-eslint').traceAsyncFn(async ()=>{
|
|
140
140
|
var _config_eslint;
|
|
141
141
|
await (0, _verifyAndLint.verifyAndLint)(dir, eslintCacheDir, (_config_eslint = config.eslint) == null ? void 0 : _config_eslint.dirs, config.experimental.workerThreads, telemetry);
|
|
142
|
+
const checkEnd = process.hrtime(typeCheckAndLintStart);
|
|
143
|
+
return checkEnd;
|
|
142
144
|
})
|
|
143
145
|
]);
|
|
144
146
|
if (typeCheckingAndLintingSpinner) {
|
|
145
|
-
|
|
146
|
-
typeCheckingAndLintingSpinner.
|
|
147
|
+
var _createSpinner;
|
|
148
|
+
typeCheckingAndLintingSpinner.stop();
|
|
149
|
+
(_createSpinner = (0, _spinner.default)(`Finished TypeScript${ignoreTypeScriptErrors ? ' config validation' : ''} in ${(0, _durationtostring.hrtimeDurationToString)(typeCheckEnd)}`)) == null ? void 0 : _createSpinner.stopAndPersist();
|
|
150
|
+
if (lintCheckEnd) {
|
|
151
|
+
var _createSpinner1;
|
|
152
|
+
(_createSpinner1 = (0, _spinner.default)(`Finished ESLint in ${(0, _durationtostring.hrtimeDurationToString)(lintCheckEnd)}`)) == null ? void 0 : _createSpinner1.stopAndPersist();
|
|
153
|
+
}
|
|
147
154
|
}
|
|
148
155
|
if (!ignoreTypeScriptErrors && verifyResult) {
|
|
149
156
|
var _verifyResult_result, _verifyResult_result1, _verifyResult_result2;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/build/type-check.ts"],"sourcesContent":["import type { NextConfigComplete } from '../server/config-shared'\nimport type { Telemetry } from '../telemetry/storage'\nimport type { Span } from '../trace'\n\nimport path from 'path'\nimport * as Log from './output/log'\nimport { Worker } from '../lib/worker'\nimport { verifyAndLint } from '../lib/verifyAndLint'\nimport createSpinner from './spinner'\nimport { eventTypeCheckCompleted } from '../telemetry/events'\nimport isError from '../lib/is-error'\nimport { hrtimeDurationToString } from './duration-to-string'\n\n/**\n * typescript will be loaded in \"next/lib/verify-typescript-setup\" and\n * then passed to \"next/lib/typescript/runTypeCheck\" as a parameter.\n *\n * Since it is impossible to pass a function from main thread to a worker,\n * instead of running \"next/lib/typescript/runTypeCheck\" in a worker,\n * we will run entire \"next/lib/verify-typescript-setup\" in a worker instead.\n */\nfunction verifyTypeScriptSetup(\n dir: string,\n distDir: string,\n intentDirs: string[],\n typeCheckPreflight: boolean,\n tsconfigPath: string | undefined,\n disableStaticImages: boolean,\n cacheDir: string | undefined,\n enableWorkerThreads: boolean | undefined,\n hasAppDir: boolean,\n hasPagesDir: boolean\n) {\n const typeCheckWorker = new Worker(\n require.resolve('../lib/verify-typescript-setup'),\n {\n exposedMethods: ['verifyTypeScriptSetup'],\n debuggerPortOffset: -1,\n isolatedMemory: false,\n numWorkers: 1,\n enableWorkerThreads,\n maxRetries: 0,\n }\n ) as Worker & {\n verifyTypeScriptSetup: typeof import('../lib/verify-typescript-setup').verifyTypeScriptSetup\n }\n\n return typeCheckWorker\n .verifyTypeScriptSetup({\n dir,\n distDir,\n intentDirs,\n typeCheckPreflight,\n tsconfigPath,\n disableStaticImages,\n cacheDir,\n hasAppDir,\n hasPagesDir,\n })\n .then((result) => {\n typeCheckWorker.end()\n return result\n })\n .catch(() => {\n // The error is already logged in the worker, we simply exit the main thread to prevent the\n // `Jest worker encountered 1 child process exceptions, exceeding retry limit` from showing up\n process.exit(1)\n })\n}\n\nexport async function startTypeChecking({\n cacheDir,\n config,\n dir,\n ignoreESLint,\n nextBuildSpan,\n pagesDir,\n runLint,\n shouldLint,\n telemetry,\n appDir,\n}: {\n cacheDir: string\n config: NextConfigComplete\n dir: string\n ignoreESLint: boolean\n nextBuildSpan: Span\n pagesDir?: string\n runLint: boolean\n shouldLint: boolean\n telemetry: Telemetry\n appDir?: string\n}) {\n const ignoreTypeScriptErrors = Boolean(config.typescript.ignoreBuildErrors)\n\n const eslintCacheDir = path.join(cacheDir, 'eslint/')\n\n if (ignoreTypeScriptErrors) {\n Log.info('Skipping validation of types')\n }\n if (runLint && ignoreESLint) {\n // only print log when build require lint while ignoreESLint is enabled\n Log.info('Skipping linting')\n }\n\n let typeCheckingAndLintingSpinnerPrefixText: string | undefined\n let typeCheckingAndLintingSpinner:\n | ReturnType<typeof createSpinner>\n | undefined\n\n if (!ignoreTypeScriptErrors && shouldLint) {\n typeCheckingAndLintingSpinnerPrefixText =\n 'Linting and checking validity of types'\n } else if (!ignoreTypeScriptErrors) {\n typeCheckingAndLintingSpinnerPrefixText = 'Checking validity of types'\n } else if (shouldLint) {\n typeCheckingAndLintingSpinnerPrefixText = 'Linting'\n }\n\n // we will not create a spinner if both ignoreTypeScriptErrors and ignoreESLint are\n // enabled, but we will still verifying project's tsconfig and dependencies.\n if (typeCheckingAndLintingSpinnerPrefixText) {\n typeCheckingAndLintingSpinner = createSpinner(\n typeCheckingAndLintingSpinnerPrefixText\n )\n }\n\n const typeCheckStart = process.hrtime()\n\n try {\n const [[verifyResult, typeCheckEnd]] = await Promise.all([\n nextBuildSpan.traceChild('run-typescript').traceAsyncFn(() =>\n verifyTypeScriptSetup(\n dir,\n config.distDir,\n [pagesDir, appDir].filter(Boolean) as string[],\n !ignoreTypeScriptErrors,\n config.typescript.tsconfigPath,\n config.images.disableStaticImages,\n cacheDir,\n config.experimental.workerThreads,\n !!appDir,\n !!pagesDir\n ).then((resolved) => {\n const checkEnd = process.hrtime(typeCheckStart)\n return [resolved, checkEnd] as const\n })\n ),\n shouldLint &&\n nextBuildSpan.traceChild('run-eslint').traceAsyncFn(async () => {\n await verifyAndLint(\n dir,\n eslintCacheDir,\n config.eslint?.dirs,\n config.experimental.workerThreads,\n telemetry\n )\n }),\n ])\n\n if (typeCheckingAndLintingSpinner) {\n typeCheckingAndLintingSpinner.setText(\n `${typeCheckingAndLintingSpinnerPrefixText} in ${hrtimeDurationToString(typeCheckEnd)}`\n )\n typeCheckingAndLintingSpinner.stopAndPersist()\n }\n\n if (!ignoreTypeScriptErrors && verifyResult) {\n telemetry.record(\n eventTypeCheckCompleted({\n durationInSeconds: typeCheckEnd[0],\n typescriptVersion: verifyResult.version,\n inputFilesCount: verifyResult.result?.inputFilesCount,\n totalFilesCount: verifyResult.result?.totalFilesCount,\n incremental: verifyResult.result?.incremental,\n })\n )\n }\n } catch (err) {\n // prevent showing jest-worker internal error as it\n // isn't helpful for users and clutters output\n if (isError(err) && err.message === 'Call retries were exceeded') {\n await telemetry.flush()\n process.exit(1)\n }\n throw err\n }\n}\n"],"names":["startTypeChecking","verifyTypeScriptSetup","dir","distDir","intentDirs","typeCheckPreflight","tsconfigPath","disableStaticImages","cacheDir","enableWorkerThreads","hasAppDir","hasPagesDir","typeCheckWorker","Worker","require","resolve","exposedMethods","debuggerPortOffset","isolatedMemory","numWorkers","maxRetries","then","result","end","catch","process","exit","config","ignoreESLint","nextBuildSpan","pagesDir","runLint","shouldLint","telemetry","appDir","ignoreTypeScriptErrors","Boolean","typescript","ignoreBuildErrors","eslintCacheDir","path","join","Log","info","typeCheckingAndLintingSpinnerPrefixText","typeCheckingAndLintingSpinner","createSpinner","typeCheckStart","hrtime","verifyResult","typeCheckEnd","Promise","all","traceChild","traceAsyncFn","filter","images","experimental","workerThreads","resolved","checkEnd","verifyAndLint","eslint","dirs","setText","hrtimeDurationToString","stopAndPersist","record","eventTypeCheckCompleted","durationInSeconds","typescriptVersion","version","inputFilesCount","totalFilesCount","incremental","err","isError","message","flush"],"mappings":";;;;+BAsEsBA;;;eAAAA;;;6DAlEL;6DACI;wBACE;+BACO;gEACJ;wBACc;gEACpB;kCACmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEvC;;;;;;;CAOC,GACD,SAASC,sBACPC,GAAW,EACXC,OAAe,EACfC,UAAoB,EACpBC,kBAA2B,EAC3BC,YAAgC,EAChCC,mBAA4B,EAC5BC,QAA4B,EAC5BC,mBAAwC,EACxCC,SAAkB,EAClBC,WAAoB;IAEpB,MAAMC,kBAAkB,IAAIC,cAAM,CAChCC,QAAQC,OAAO,CAAC,mCAChB;QACEC,gBAAgB;YAAC;SAAwB;QACzCC,oBAAoB,CAAC;QACrBC,gBAAgB;QAChBC,YAAY;QACZV;QACAW,YAAY;IACd;IAKF,OAAOR,gBACJX,qBAAqB,CAAC;QACrBC;QACAC;QACAC;QACAC;QACAC;QACAC;QACAC;QACAE;QACAC;IACF,GACCU,IAAI,CAAC,CAACC;QACLV,gBAAgBW,GAAG;QACnB,OAAOD;IACT,GACCE,KAAK,CAAC;QACL,2FAA2F;QAC3F,8FAA8F;QAC9FC,QAAQC,IAAI,CAAC;I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cACEH,cAAcwB,UAAU,CAAC,cAAcC,YAAY,CAAC;oBAIhD3B;gBAHF,MAAMkC,IAAAA,4BAAa,EACjB3D,KACAqC,iBACAZ,iBAAAA,OAAOmC,MAAM,qBAAbnC,eAAeoC,IAAI,EACnBpC,OAAO8B,YAAY,CAACC,aAAa,EACjCzB;YAEJ;SACH;QAED,IAAIY,+BAA+B;YACjCA,8BAA8BmB,OAAO,CACnC,GAAGpB,wCAAwC,IAAI,EAAEqB,IAAAA,wCAAsB,EAACf,eAAe;YAEzFL,8BAA8BqB,cAAc;QAC9C;QAEA,IAAI,CAAC/B,0BAA0Bc,cAAc;gBAKtBA,sBACAA,uBACJA;YANjBhB,UAAUkC,MAAM,CACdC,IAAAA,+BAAuB,EAAC;gBACtBC,mBAAmBnB,YAAY,CAAC,EAAE;gBAClCoB,mBAAmBrB,aAAasB,OAAO;gBACvCC,eAAe,GAAEvB,uBAAAA,aAAa3B,MAAM,qBAAnB2B,qBAAqBuB,eAAe;gBACrDC,eAAe,GAAExB,wBAAAA,aAAa3B,MAAM,qBAAnB2B,sBAAqBwB,eAAe;gBACrDC,WAAW,GAAEzB,wBAAAA,aAAa3B,MAAM,qBAAnB2B,sBAAqByB,WAAW;YAC/C;QAEJ;IACF,EAAE,OAAOC,KAAK;QACZ,mDAAmD;QACnD,8CAA8C;QAC9C,IAAIC,IAAAA,gBAAO,EAACD,QAAQA,IAAIE,OAAO,KAAK,8BAA8B;YAChE,MAAM5C,UAAU6C,KAAK;YACrBrD,QAAQC,IAAI,CAAC;QACf;QACA,MAAMiD;IACR;AACF","ignoreList":[0]}
|
|
1
|
+
{"version":3,"sources":["../../src/build/type-check.ts"],"sourcesContent":["import type { NextConfigComplete } from '../server/config-shared'\nimport type { Telemetry } from '../telemetry/storage'\nimport type { Span } from '../trace'\n\nimport path from 'path'\nimport * as Log from './output/log'\nimport { Worker } from '../lib/worker'\nimport { verifyAndLint } from '../lib/verifyAndLint'\nimport createSpinner from './spinner'\nimport { eventTypeCheckCompleted } from '../telemetry/events'\nimport isError from '../lib/is-error'\nimport { hrtimeDurationToString } from './duration-to-string'\n\n/**\n * typescript will be loaded in \"next/lib/verify-typescript-setup\" and\n * then passed to \"next/lib/typescript/runTypeCheck\" as a parameter.\n *\n * Since it is impossible to pass a function from main thread to a worker,\n * instead of running \"next/lib/typescript/runTypeCheck\" in a worker,\n * we will run entire \"next/lib/verify-typescript-setup\" in a worker instead.\n */\nfunction verifyTypeScriptSetup(\n dir: string,\n distDir: string,\n intentDirs: string[],\n typeCheckPreflight: boolean,\n tsconfigPath: string | undefined,\n disableStaticImages: boolean,\n cacheDir: string | undefined,\n enableWorkerThreads: boolean | undefined,\n hasAppDir: boolean,\n hasPagesDir: boolean\n) {\n const typeCheckWorker = new Worker(\n require.resolve('../lib/verify-typescript-setup'),\n {\n exposedMethods: ['verifyTypeScriptSetup'],\n debuggerPortOffset: -1,\n isolatedMemory: false,\n numWorkers: 1,\n enableWorkerThreads,\n maxRetries: 0,\n }\n ) as Worker & {\n verifyTypeScriptSetup: typeof import('../lib/verify-typescript-setup').verifyTypeScriptSetup\n }\n\n return typeCheckWorker\n .verifyTypeScriptSetup({\n dir,\n distDir,\n intentDirs,\n typeCheckPreflight,\n tsconfigPath,\n disableStaticImages,\n cacheDir,\n hasAppDir,\n hasPagesDir,\n })\n .then((result) => {\n typeCheckWorker.end()\n return result\n })\n .catch(() => {\n // The error is already logged in the worker, we simply exit the main thread to prevent the\n // `Jest worker encountered 1 child process exceptions, exceeding retry limit` from showing up\n process.exit(1)\n })\n}\n\nexport async function startTypeChecking({\n cacheDir,\n config,\n dir,\n ignoreESLint,\n nextBuildSpan,\n pagesDir,\n runLint,\n shouldLint,\n telemetry,\n appDir,\n}: {\n cacheDir: string\n config: NextConfigComplete\n dir: string\n ignoreESLint: boolean\n nextBuildSpan: Span\n pagesDir?: string\n runLint: boolean\n shouldLint: boolean\n telemetry: Telemetry\n appDir?: string\n}) {\n const ignoreTypeScriptErrors = Boolean(config.typescript.ignoreBuildErrors)\n\n const eslintCacheDir = path.join(cacheDir, 'eslint/')\n\n if (ignoreTypeScriptErrors) {\n Log.info('Skipping validation of types')\n }\n if (runLint && ignoreESLint) {\n // only print log when build require lint while ignoreESLint is enabled\n Log.info('Skipping linting')\n }\n\n let typeCheckingAndLintingSpinnerPrefixText: string | undefined\n let typeCheckingAndLintingSpinner:\n | ReturnType<typeof createSpinner>\n | undefined\n\n if (!ignoreTypeScriptErrors && shouldLint) {\n typeCheckingAndLintingSpinnerPrefixText =\n 'Running ESLint and TypeScript concurrently'\n } else if (!ignoreTypeScriptErrors) {\n typeCheckingAndLintingSpinnerPrefixText = 'Running TypeScript'\n } else if (shouldLint) {\n typeCheckingAndLintingSpinnerPrefixText = 'Running ESLint'\n }\n\n // we will not create a spinner if both ignoreTypeScriptErrors and ignoreESLint are\n // enabled, but we will still verifying project's tsconfig and dependencies.\n if (typeCheckingAndLintingSpinnerPrefixText) {\n typeCheckingAndLintingSpinner = createSpinner(\n typeCheckingAndLintingSpinnerPrefixText\n )\n }\n\n const typeCheckAndLintStart = process.hrtime()\n\n try {\n const [[verifyResult, typeCheckEnd], lintCheckEnd] = await Promise.all([\n nextBuildSpan.traceChild('run-typescript').traceAsyncFn(() =>\n verifyTypeScriptSetup(\n dir,\n config.distDir,\n [pagesDir, appDir].filter(Boolean) as string[],\n !ignoreTypeScriptErrors,\n config.typescript.tsconfigPath,\n config.images.disableStaticImages,\n cacheDir,\n config.experimental.workerThreads,\n !!appDir,\n !!pagesDir\n ).then((resolved) => {\n const checkEnd = process.hrtime(typeCheckAndLintStart)\n return [resolved, checkEnd] as const\n })\n ),\n shouldLint &&\n nextBuildSpan.traceChild('run-eslint').traceAsyncFn(async () => {\n await verifyAndLint(\n dir,\n eslintCacheDir,\n config.eslint?.dirs,\n config.experimental.workerThreads,\n telemetry\n )\n const checkEnd = process.hrtime(typeCheckAndLintStart)\n return checkEnd\n }),\n ])\n\n if (typeCheckingAndLintingSpinner) {\n typeCheckingAndLintingSpinner.stop()\n\n createSpinner(\n `Finished TypeScript${ignoreTypeScriptErrors ? ' config validation' : ''} in ${hrtimeDurationToString(typeCheckEnd)}`\n )?.stopAndPersist()\n if (lintCheckEnd) {\n createSpinner(\n `Finished ESLint in ${hrtimeDurationToString(lintCheckEnd)}`\n )?.stopAndPersist()\n }\n }\n\n if (!ignoreTypeScriptErrors && verifyResult) {\n telemetry.record(\n eventTypeCheckCompleted({\n durationInSeconds: typeCheckEnd[0],\n typescriptVersion: verifyResult.version,\n inputFilesCount: verifyResult.result?.inputFilesCount,\n totalFilesCount: verifyResult.result?.totalFilesCount,\n incremental: verifyResult.result?.incremental,\n })\n )\n }\n } catch (err) {\n // prevent showing jest-worker internal error as it\n // isn't helpful for users and clutters output\n if (isError(err) && err.message === 'Call retries were exceeded') {\n await telemetry.flush()\n process.exit(1)\n }\n throw err\n }\n}\n"],"names":["startTypeChecking","verifyTypeScriptSetup","dir","distDir","intentDirs","typeCheckPreflight","tsconfigPath","disableStaticImages","cacheDir","enableWorkerThreads","hasAppDir","hasPagesDir","typeCheckWorker","Worker","require","resolve","exposedMethods","debuggerPortOffset","isolatedMemory","numWorkers","maxRetries","then","result","end","catch","process","exit","config","ignoreESLint","nextBuildSpan","pagesDir","runLint","shouldLint","telemetry","appDir","ignoreTypeScriptErrors","Boolean","typescript","ignoreBuildErrors","eslintCacheDir","path","join","Log","info","typeCheckingAndLintingSpinnerPrefixText","typeCheckingAndLintingSpinner","createSpinner","typeCheckAndLintStart","hrtime","verifyResult","typeCheckEnd","lintCheckEnd","Promise","all","traceChild","traceAsyncFn","filter","images","experimental","workerThreads","resolved","checkEnd","verifyAndLint","eslint","dirs","stop","hrtimeDurationToString","stopAndPersist","record","eventTypeCheckCompleted","durationInSeconds","typescriptVersion","version","inputFilesCount","totalFilesCount","incremental","err","isError","message","flush"],"mappings":";;;;+BAsEsBA;;;eAAAA;;;6DAlEL;6DACI;wBACE;+BACO;gEACJ;wBACc;gEACpB;kCACmB;;;;;;;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9DL,gBAEGqB,cAAc;YACnB;QACF;QAEA,IAAI,CAAChC,0BAA0Bc,cAAc;gBAKtBA,sBACAA,uBACJA;YANjBhB,UAAUmC,MAAM,CACdC,IAAAA,+BAAuB,EAAC;gBACtBC,mBAAmBpB,YAAY,CAAC,EAAE;gBAClCqB,mBAAmBtB,aAAauB,OAAO;gBACvCC,eAAe,GAAExB,uBAAAA,aAAa3B,MAAM,qBAAnB2B,qBAAqBwB,eAAe;gBACrDC,eAAe,GAAEzB,wBAAAA,aAAa3B,MAAM,qBAAnB2B,sBAAqByB,eAAe;gBACrDC,WAAW,GAAE1B,wBAAAA,aAAa3B,MAAM,qBAAnB2B,sBAAqB0B,WAAW;YAC/C;QAEJ;IACF,EAAE,OAAOC,KAAK;QACZ,mDAAmD;QACnD,8CAA8C;QAC9C,IAAIC,IAAAA,gBAAO,EAACD,QAAQA,IAAIE,OAAO,KAAK,8BAA8B;YAChE,MAAM7C,UAAU8C,KAAK;YACrBtD,QAAQC,IAAI,CAAC;QACf;QACA,MAAMkD;IACR;AACF","ignoreList":[0]}
|
|
@@ -145,21 +145,7 @@ const css = (0, _lodashcurry.default)(async function css(ctx, config) {
|
|
|
145
145
|
// Source maps are required so that `resolve-url-loader` can locate
|
|
146
146
|
// files original to their source directory.
|
|
147
147
|
sourceMap: true,
|
|
148
|
-
sassOptions
|
|
149
|
-
// The "fibers" option is not needed for Node.js 16+, but it's causing
|
|
150
|
-
// problems for Node.js <= 14 users as you'll have to manually install
|
|
151
|
-
// the `fibers` package:
|
|
152
|
-
// https://github.com/webpack-contrib/sass-loader#:~:text=We%20automatically%20inject%20the%20fibers%20package
|
|
153
|
-
// https://github.com/vercel/next.js/issues/45052
|
|
154
|
-
// Since it's optional and not required, we'll disable it by default
|
|
155
|
-
// to avoid the confusion.
|
|
156
|
-
fibers: false,
|
|
157
|
-
// TODO: Remove this once we upgrade to sass-loader 16
|
|
158
|
-
silenceDeprecations: [
|
|
159
|
-
'legacy-js-api'
|
|
160
|
-
],
|
|
161
|
-
...sassOptions
|
|
162
|
-
},
|
|
148
|
+
sassOptions,
|
|
163
149
|
additionalData: sassPrependData || sassAdditionalData
|
|
164
150
|
}
|
|
165
151
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../../src/build/webpack/config/blocks/css/index.ts"],"sourcesContent":["import curry from 'next/dist/compiled/lodash.curry'\nimport type { webpack } from 'next/dist/compiled/webpack/webpack'\nimport { loader, plugin } from '../../helpers'\nimport { pipe } from '../../utils'\nimport type { ConfigurationContext, ConfigurationFn } from '../../utils'\nimport { getCssModuleLoader, getGlobalCssLoader } from './loaders'\nimport { getNextFontLoader } from './loaders/next-font'\nimport {\n getCustomDocumentError,\n getGlobalImportError,\n getGlobalModuleImportError,\n getLocalModuleImportError,\n} from './messages'\nimport { getPostCssPlugins } from './plugins'\nimport { nonNullable } from '../../../../../lib/non-nullable'\nimport { WEBPACK_LAYERS } from '../../../../../lib/constants'\nimport { getRspackCore } from '../../../../../shared/lib/get-rspack'\n\n// RegExps for all Style Sheet variants\nexport const regexLikeCss = /\\.(css|scss|sass)$/\n\n// RegExps for Style Sheets\nconst regexCssGlobal = /(?<!\\.module)\\.css$/\nconst regexCssModules = /\\.module\\.css$/\n\n// RegExps for Syntactically Awesome Style Sheets\nconst regexSassGlobal = /(?<!\\.module)\\.(scss|sass)$/\nconst regexSassModules = /\\.module\\.(scss|sass)$/\n\nconst APP_LAYER_RULE = {\n or: [\n WEBPACK_LAYERS.reactServerComponents,\n WEBPACK_LAYERS.serverSideRendering,\n WEBPACK_LAYERS.appPagesBrowser,\n ],\n}\n\nconst PAGES_LAYER_RULE = {\n not: [\n WEBPACK_LAYERS.reactServerComponents,\n WEBPACK_LAYERS.serverSideRendering,\n WEBPACK_LAYERS.appPagesBrowser,\n ],\n}\n\n/**\n * Mark a rule as removable if built-in CSS support is disabled\n */\nfunction markRemovable(r: webpack.RuleSetRule): webpack.RuleSetRule {\n Object.defineProperty(r, Symbol.for('__next_css_remove'), {\n enumerable: false,\n value: true,\n })\n return r\n}\n\nlet postcssInstancePromise: Promise<any>\nexport async function lazyPostCSS(\n rootDirectory: string,\n supportedBrowsers: string[] | undefined,\n disablePostcssPresetEnv: boolean | undefined,\n useLightningcss: boolean | undefined\n) {\n if (!postcssInstancePromise) {\n postcssInstancePromise = (async () => {\n const postcss = require('postcss') as typeof import('postcss')\n // @ts-ignore backwards compat\n postcss.plugin = function postcssPlugin(name, initializer) {\n function creator(...args: any) {\n let transformer = initializer(...args)\n transformer.postcssPlugin = name\n // transformer.postcssVersion = new Processor().version\n return transformer\n }\n\n let cache: any\n Object.defineProperty(creator, 'postcss', {\n get() {\n if (!cache) cache = creator()\n return cache\n },\n })\n\n creator.process = function (\n css: any,\n processOpts: any,\n pluginOpts: any\n ) {\n return postcss([creator(pluginOpts)]).process(css, processOpts)\n }\n\n return creator\n }\n\n // @ts-ignore backwards compat\n postcss.vendor = {\n /**\n * Returns the vendor prefix extracted from an input string.\n *\n * @example\n * postcss.vendor.prefix('-moz-tab-size') //=> '-moz-'\n * postcss.vendor.prefix('tab-size') //=> ''\n */\n prefix: function prefix(prop: string): string {\n const match = prop.match(/^(-\\w+-)/)\n\n if (match) {\n return match[0]\n }\n\n return ''\n },\n\n /**\n * Returns the input string stripped of its vendor prefix.\n *\n * @example\n * postcss.vendor.unprefixed('-moz-tab-size') //=> 'tab-size'\n */\n unprefixed: function unprefixed(\n /**\n * String with or without vendor prefix.\n */\n prop: string\n ): string {\n return prop.replace(/^-\\w+-/, '')\n },\n }\n\n const postCssPlugins = await getPostCssPlugins(\n rootDirectory,\n supportedBrowsers,\n disablePostcssPresetEnv,\n useLightningcss\n )\n\n return {\n postcss,\n postcssWithPlugins: postcss(postCssPlugins),\n }\n })()\n }\n\n return postcssInstancePromise\n}\n\nexport const css = curry(async function css(\n ctx: ConfigurationContext,\n config: webpack.Configuration\n) {\n const isRspack = Boolean(process.env.NEXT_RSPACK)\n const {\n prependData: sassPrependData,\n additionalData: sassAdditionalData,\n implementation: sassImplementation,\n ...sassOptions\n } = ctx.sassOptions\n\n const lazyPostCSSInitializer = () =>\n lazyPostCSS(\n ctx.rootDirectory,\n ctx.supportedBrowsers,\n ctx.experimental.disablePostcssPresetEnv,\n ctx.experimental.useLightningcss\n )\n\n const sassPreprocessors: webpack.RuleSetUseItem[] = [\n // First, process files with `sass-loader`: this inlines content, and\n // compiles away the proprietary syntax.\n {\n loader: require.resolve('next/dist/compiled/sass-loader'),\n options: {\n implementation: sassImplementation,\n // Source maps are required so that `resolve-url-loader` can locate\n // files original to their source directory.\n sourceMap: true,\n sassOptions: {\n // The \"fibers\" option is not needed for Node.js 16+, but it's causing\n // problems for Node.js <= 14 users as you'll have to manually install\n // the `fibers` package:\n // https://github.com/webpack-contrib/sass-loader#:~:text=We%20automatically%20inject%20the%20fibers%20package\n // https://github.com/vercel/next.js/issues/45052\n // Since it's optional and not required, we'll disable it by default\n // to avoid the confusion.\n fibers: false,\n // TODO: Remove this once we upgrade to sass-loader 16\n silenceDeprecations: ['legacy-js-api'],\n ...sassOptions,\n },\n additionalData: sassPrependData || sassAdditionalData,\n },\n },\n // Then, `sass-loader` will have passed-through CSS imports as-is instead\n // of inlining them. Because they were inlined, the paths are no longer\n // correct.\n // To fix this, we use `resolve-url-loader` to rewrite the CSS\n // imports to real file paths.\n {\n loader: require.resolve('../../../loaders/resolve-url-loader/index'),\n options: {\n postcss: lazyPostCSSInitializer,\n // Source maps are not required here, but we may as well emit\n // them.\n sourceMap: true,\n },\n },\n ]\n\n const fns: ConfigurationFn[] = []\n\n const googleLoader = require.resolve(\n 'next/dist/compiled/@next/font/google/loader'\n )\n const localLoader = require.resolve(\n 'next/dist/compiled/@next/font/local/loader'\n )\n const nextFontLoaders: Array<[string | RegExp, string, any?]> = [\n [require.resolve('next/font/google/target.css'), googleLoader],\n [require.resolve('next/font/local/target.css'), localLoader],\n ]\n\n nextFontLoaders.forEach(([fontLoaderTarget, fontLoaderPath]) => {\n // Matches the resolved font loaders noop files to run next-font-loader\n fns.push(\n loader({\n oneOf: [\n markRemovable({\n sideEffects: false,\n test: fontLoaderTarget,\n use: getNextFontLoader(ctx, lazyPostCSSInitializer, fontLoaderPath),\n }),\n ],\n })\n )\n })\n\n // CSS cannot be imported in _document. This comes before everything because\n // global CSS nor CSS modules work in said file.\n fns.push(\n loader({\n oneOf: [\n markRemovable({\n test: regexLikeCss,\n // Use a loose regex so we don't have to crawl the file system to\n // find the real file name (if present).\n issuer: /pages[\\\\/]_document\\./,\n use: {\n loader: 'error-loader',\n options: {\n reason: getCustomDocumentError(),\n },\n },\n }),\n ],\n })\n )\n\n const shouldIncludeExternalCSSImports =\n !!ctx.experimental.craCompat || !!ctx.transpilePackages\n\n // CSS modules & SASS modules support. They are allowed to be imported in anywhere.\n fns.push(\n // CSS Modules should never have side effects. This setting will\n // allow unused CSS to be removed from the production build.\n // We ensure this by disallowing `:global()` CSS at the top-level\n // via the `pure` mode in `css-loader`.\n loader({\n oneOf: [\n // For app dir, we need to match the specific app layer.\n ctx.hasAppDir\n ? markRemovable({\n sideEffects: true,\n test: regexCssModules,\n issuerLayer: APP_LAYER_RULE,\n use: [\n {\n loader: require.resolve(\n '../../../loaders/next-flight-css-loader'\n ),\n options: {\n cssModules: true,\n },\n },\n ...getCssModuleLoader(\n { ...ctx, isAppDir: true },\n lazyPostCSSInitializer\n ),\n ],\n })\n : null,\n markRemovable({\n sideEffects: true,\n test: regexCssModules,\n issuerLayer: PAGES_LAYER_RULE,\n use: getCssModuleLoader(\n { ...ctx, isAppDir: false },\n lazyPostCSSInitializer\n ),\n }),\n ].filter(nonNullable),\n }),\n // Opt-in support for Sass (using .scss or .sass extensions).\n // Sass Modules should never have side effects. This setting will\n // allow unused Sass to be removed from the production build.\n // We ensure this by disallowing `:global()` Sass at the top-level\n // via the `pure` mode in `css-loader`.\n loader({\n oneOf: [\n // For app dir, we need to match the specific app layer.\n ctx.hasAppDir\n ? markRemovable({\n sideEffects: true,\n test: regexSassModules,\n issuerLayer: APP_LAYER_RULE,\n use: [\n {\n loader: require.resolve(\n '../../../loaders/next-flight-css-loader'\n ),\n options: {\n cssModules: true,\n },\n },\n ...getCssModuleLoader(\n { ...ctx, isAppDir: true },\n lazyPostCSSInitializer,\n sassPreprocessors\n ),\n ],\n })\n : null,\n markRemovable({\n sideEffects: true,\n test: regexSassModules,\n issuerLayer: PAGES_LAYER_RULE,\n use: getCssModuleLoader(\n { ...ctx, isAppDir: false },\n lazyPostCSSInitializer,\n sassPreprocessors\n ),\n }),\n ].filter(nonNullable),\n }),\n // Throw an error for CSS Modules used outside their supported scope\n loader({\n oneOf: [\n markRemovable({\n test: [regexCssModules, regexSassModules],\n use: {\n loader: 'error-loader',\n options: {\n reason: getLocalModuleImportError(),\n },\n },\n }),\n ],\n })\n )\n\n // Global CSS and SASS support.\n if (ctx.isServer) {\n fns.push(\n loader({\n oneOf: [\n ctx.hasAppDir && !ctx.isProduction\n ? markRemovable({\n sideEffects: true,\n test: [regexCssGlobal, regexSassGlobal],\n issuerLayer: APP_LAYER_RULE,\n use: {\n loader: require.resolve(\n '../../../loaders/next-flight-css-loader'\n ),\n options: {\n cssModules: false,\n },\n },\n })\n : null,\n markRemovable({\n // CSS imports have side effects, even on the server side.\n sideEffects: true,\n test: [regexCssGlobal, regexSassGlobal],\n use: require.resolve('next/dist/compiled/ignore-loader'),\n }),\n ].filter(nonNullable),\n })\n )\n } else {\n // External CSS files are allowed to be loaded when any of the following is true:\n // - hasAppDir: all CSS files are allowed\n // - If the CSS file is located in `node_modules`\n // - If the CSS file is located in another package in a monorepo (outside of the current rootDir)\n // - If the issuer is pages/_app (matched later)\n const allowedPagesGlobalCSSPath = ctx.hasAppDir\n ? undefined\n : {\n and: [\n {\n or: [\n /node_modules/,\n {\n not: [ctx.rootDirectory],\n },\n ],\n },\n ],\n }\n const allowedPagesGlobalCSSIssuer = ctx.hasAppDir\n ? undefined\n : shouldIncludeExternalCSSImports\n ? undefined\n : {\n and: [ctx.rootDirectory],\n not: [/node_modules/],\n }\n\n fns.push(\n loader({\n oneOf: [\n ...(ctx.hasAppDir\n ? [\n markRemovable({\n sideEffects: true,\n test: regexCssGlobal,\n issuerLayer: APP_LAYER_RULE,\n use: [\n {\n loader: require.resolve(\n '../../../loaders/next-flight-css-loader'\n ),\n options: {\n cssModules: false,\n },\n },\n ...getGlobalCssLoader(\n { ...ctx, isAppDir: true },\n lazyPostCSSInitializer\n ),\n ],\n }),\n markRemovable({\n sideEffects: true,\n test: regexSassGlobal,\n issuerLayer: APP_LAYER_RULE,\n use: [\n {\n loader: require.resolve(\n '../../../loaders/next-flight-css-loader'\n ),\n options: {\n cssModules: false,\n },\n },\n ...getGlobalCssLoader(\n { ...ctx, isAppDir: true },\n lazyPostCSSInitializer,\n sassPreprocessors\n ),\n ],\n }),\n ]\n : []),\n markRemovable({\n sideEffects: true,\n test: regexCssGlobal,\n include: allowedPagesGlobalCSSPath,\n issuer: allowedPagesGlobalCSSIssuer,\n issuerLayer: PAGES_LAYER_RULE,\n use: getGlobalCssLoader(\n { ...ctx, isAppDir: false },\n lazyPostCSSInitializer\n ),\n }),\n markRemovable({\n sideEffects: true,\n test: regexSassGlobal,\n include: allowedPagesGlobalCSSPath,\n issuer: allowedPagesGlobalCSSIssuer,\n issuerLayer: PAGES_LAYER_RULE,\n use: getGlobalCssLoader(\n { ...ctx, isAppDir: false },\n lazyPostCSSInitializer,\n sassPreprocessors\n ),\n }),\n ].filter(nonNullable),\n })\n )\n\n if (ctx.customAppFile) {\n fns.push(\n loader({\n oneOf: [\n markRemovable({\n sideEffects: true,\n test: regexCssGlobal,\n issuer: { and: [ctx.customAppFile] },\n use: getGlobalCssLoader(\n { ...ctx, isAppDir: false },\n lazyPostCSSInitializer\n ),\n }),\n ],\n }),\n loader({\n oneOf: [\n markRemovable({\n sideEffects: true,\n test: regexSassGlobal,\n issuer: { and: [ctx.customAppFile] },\n use: getGlobalCssLoader(\n { ...ctx, isAppDir: false },\n lazyPostCSSInitializer,\n sassPreprocessors\n ),\n }),\n ],\n })\n )\n }\n }\n\n // Throw an error for Global CSS used inside of `node_modules`\n if (!shouldIncludeExternalCSSImports) {\n fns.push(\n loader({\n oneOf: [\n markRemovable({\n test: [regexCssGlobal, regexSassGlobal],\n issuer: { and: [/node_modules/] },\n use: {\n loader: 'error-loader',\n options: {\n reason: getGlobalModuleImportError(),\n },\n },\n }),\n ],\n })\n )\n }\n\n // Throw an error for Global CSS used outside of our custom <App> file\n fns.push(\n loader({\n oneOf: [\n markRemovable({\n test: [regexCssGlobal, regexSassGlobal],\n issuer: ctx.hasAppDir\n ? {\n // If it's inside the app dir, but not importing from a layout file,\n // throw an error.\n and: [ctx.rootDirectory],\n not: [/layout\\.(js|mjs|jsx|ts|tsx)$/],\n }\n : undefined,\n use: {\n loader: 'error-loader',\n options: {\n reason: getGlobalImportError(),\n },\n },\n }),\n ],\n })\n )\n\n if (ctx.isClient) {\n // Automatically transform references to files (i.e. url()) into URLs\n // e.g. url(./logo.svg)\n fns.push(\n loader({\n oneOf: [\n markRemovable({\n // This should only be applied to CSS files\n issuer: regexLikeCss,\n // Exclude extensions that webpack handles by default\n exclude: [\n /\\.(js|mjs|jsx|ts|tsx)$/,\n /\\.html$/,\n /\\.json$/,\n /\\.webpack\\[[^\\]]+\\]$/,\n ],\n // `asset/resource` always emits a URL reference, where `asset`\n // might inline the asset as a data URI\n type: 'asset/resource',\n }),\n ],\n })\n )\n }\n\n // Enable full mini-css-extract-plugin hmr for prod mode pages or app dir\n if (ctx.isClient && (ctx.isProduction || ctx.hasAppDir)) {\n // Extract CSS as CSS file(s) in the client-side production bundle.\n const MiniCssExtractPlugin = isRspack\n ? getRspackCore().CssExtractRspackPlugin\n : (\n require('../../../plugins/mini-css-extract-plugin') as typeof import('../../../plugins/mini-css-extract-plugin')\n ).default\n\n fns.push(\n plugin(\n // @ts-ignore webpack 5 compat\n new MiniCssExtractPlugin({\n filename: ctx.isProduction\n ? 'static/css/[contenthash].css'\n : 'static/css/[name].css',\n chunkFilename: ctx.isProduction\n ? 'static/css/[contenthash].css'\n : 'static/css/[name].css',\n // Next.js guarantees that CSS order \"doesn't matter\", due to imposed\n // restrictions:\n // 1. Global CSS can only be defined in a single entrypoint (_app)\n // 2. CSS Modules generate scoped class names by default and cannot\n // include Global CSS (:global() selector).\n //\n // While not a perfect guarantee (e.g. liberal use of `:global()`\n // selector), this assumption is required to code-split CSS.\n //\n // If this warning were to trigger, it'd be unactionable by the user,\n // but likely not valid -- so we disable it.\n ignoreOrder: true,\n insert: function (linkTag: HTMLLinkElement) {\n if (typeof _N_E_STYLE_LOAD === 'function') {\n const { href, onload, onerror } = linkTag\n _N_E_STYLE_LOAD(\n href.indexOf(window.location.origin) === 0\n ? new URL(href).pathname\n : href\n ).then(\n () => onload?.call(linkTag, { type: 'load' } as Event),\n () => onerror?.call(linkTag, {} as Event)\n )\n } else {\n document.head.appendChild(linkTag)\n }\n },\n })\n )\n )\n }\n\n const fn = pipe(...fns)\n return fn(config)\n})\n"],"names":["css","lazyPostCSS","regexLikeCss","regexCssGlobal","regexCssModules","regexSassGlobal","regexSassModules","APP_LAYER_RULE","or","WEBPACK_LAYERS","reactServerComponents","serverSideRendering","appPagesBrowser","PAGES_LAYER_RULE","not","markRemovable","r","Object","defineProperty","Symbol","for","enumerable","value","postcssInstancePromise","rootDirectory","supportedBrowsers","disablePostcssPresetEnv","useLightningcss","postcss","require","plugin","postcssPlugin","name","initializer","creator","args","transformer","cache","get","process","processOpts","pluginOpts","vendor","prefix","prop","match","unprefixed","replace","postCssPlugins","getPostCssPlugins","postcssWithPlugins","curry","ctx","config","isRspack","Boolean","env","NEXT_RSPACK","prependData","sassPrependData","additionalData","sassAdditionalData","implementation","sassImplementation","sassOptions","lazyPostCSSInitializer","experimental","sassPreprocessors","loader","resolve","options","sourceMap","fibers","silenceDeprecations","fns","googleLoader","localLoader","nextFontLoaders","forEach","fontLoaderTarget","fontLoaderPath","push","oneOf","sideEffects","test","use","getNextFontLoader","issuer","reason","getCustomDocumentError","shouldIncludeExternalCSSImports","craCompat","transpilePackages","hasAppDir","issuerLayer","cssModules","getCssModuleLoader","isAppDir","filter","nonNullable","getLocalModuleImportError","isServer","isProduction","allowedPagesGlobalCSSPath","undefined","and","allowedPagesGlobalCSSIssuer","getGlobalCssLoader","include","customAppFile","getGlobalModuleImportError","getGlobalImportError","isClient","exclude","type","MiniCssExtractPlugin","getRspackCore","CssExtractRspackPlugin","default","filename","chunkFilename","ignoreOrder","insert","linkTag","_N_E_STYLE_LOAD","href","onload","onerror","indexOf","window","location","origin","URL","pathname","then","call","document","head","appendChild","fn","pipe"],"mappings":";;;;;;;;;;;;;;;;IAkJaA,GAAG;eAAHA;;IAzFSC,WAAW;eAAXA;;IAtCTC,YAAY;eAAZA;;;oEAnBK;yBAEa;uBACV;yBAEkC;0BACrB;0BAM3B;yBAC2B;6BACN;2BACG;2BACD;;;;;;AAGvB,MAAMA,eAAe;AAE5B,2BAA2B;AAC3B,MAAMC,iBAAiB;AACvB,MAAMC,kBAAkB;AAExB,iDAAiD;AACjD,MAAMC,kBAAkB;AACxB,MAAMC,mBAAmB;AAEzB,MAAMC,iBAAiB;IACrBC,IAAI;QACFC,yBAAc,CAACC,qBAAqB;QACpCD,yBAAc,CAACE,mBAAmB;QAClCF,yBAAc,CAACG,eAAe;KAC/B;AACH;AAEA,MAAMC,mBAAmB;IACvBC,KAAK;QACHL,yBAAc,CAACC,qBAAqB;QACpCD,yBAAc,CAACE,mBAAmB;QAClCF,yBAAc,CAACG,eAAe;KAC/B;AACH;AAEA;;CAEC,GACD,SAASG,cAAcC,CAAsB;IAC3CC,OAAOC,cAAc,CAACF,GAAGG,OAAOC,GAAG,CAAC,sBAAsB;QACxDC,YAAY;QACZC,OAAO;IACT;IACA,OAAON;AACT;AAEA,IAAIO;AACG,eAAetB,YACpBuB,aAAqB,EACrBC,iBAAuC,EACvCC,uBAA4C,EAC5CC,eAAoC;IAEpC,IAAI,CAACJ,wBAAwB;QAC3BA,yBA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E,GAAGJ;oBAClCC,gBACEC,KAAKG,OAAO,CAACC,OAAOC,QAAQ,CAACC,MAAM,MAAM,IACrC,IAAIC,IAAIP,MAAMQ,QAAQ,GACtBR,MACJS,IAAI,CACJ,IAAMR,0BAAAA,OAAQS,IAAI,CAACZ,SAAS;4BAAET,MAAM;wBAAO,IAC3C,IAAMa,2BAAAA,QAASQ,IAAI,CAACZ,SAAS,CAAC;gBAElC,OAAO;oBACLa,SAASC,IAAI,CAACC,WAAW,CAACf;gBAC5B;YACF;QACF;IAGN;IAEA,MAAMgB,KAAKC,IAAAA,WAAI,KAAIlE;IACnB,OAAOiE,GAAGtF;AACZ","ignoreList":[0]}
|
|
1
|
+
{"version":3,"sources":["../../../../../../src/build/webpack/config/blocks/css/index.ts"],"sourcesContent":["import curry from 'next/dist/compiled/lodash.curry'\nimport type { webpack } from 'next/dist/compiled/webpack/webpack'\nimport { loader, plugin } from '../../helpers'\nimport { pipe } from '../../utils'\nimport type { ConfigurationContext, ConfigurationFn } from '../../utils'\nimport { getCssModuleLoader, getGlobalCssLoader } from './loaders'\nimport { getNextFontLoader } from './loaders/next-font'\nimport {\n getCustomDocumentError,\n getGlobalImportError,\n getGlobalModuleImportError,\n getLocalModuleImportError,\n} from './messages'\nimport { getPostCssPlugins } from './plugins'\nimport { nonNullable } from '../../../../../lib/non-nullable'\nimport { WEBPACK_LAYERS } from '../../../../../lib/constants'\nimport { getRspackCore } from '../../../../../shared/lib/get-rspack'\n\n// RegExps for all Style Sheet variants\nexport const regexLikeCss = /\\.(css|scss|sass)$/\n\n// RegExps for Style Sheets\nconst regexCssGlobal = /(?<!\\.module)\\.css$/\nconst regexCssModules = /\\.module\\.css$/\n\n// RegExps for Syntactically Awesome Style Sheets\nconst regexSassGlobal = /(?<!\\.module)\\.(scss|sass)$/\nconst regexSassModules = /\\.module\\.(scss|sass)$/\n\nconst APP_LAYER_RULE = {\n or: [\n WEBPACK_LAYERS.reactServerComponents,\n WEBPACK_LAYERS.serverSideRendering,\n WEBPACK_LAYERS.appPagesBrowser,\n ],\n}\n\nconst PAGES_LAYER_RULE = {\n not: [\n WEBPACK_LAYERS.reactServerComponents,\n WEBPACK_LAYERS.serverSideRendering,\n WEBPACK_LAYERS.appPagesBrowser,\n ],\n}\n\n/**\n * Mark a rule as removable if built-in CSS support is disabled\n */\nfunction markRemovable(r: webpack.RuleSetRule): webpack.RuleSetRule {\n Object.defineProperty(r, Symbol.for('__next_css_remove'), {\n enumerable: false,\n value: true,\n })\n return r\n}\n\nlet postcssInstancePromise: Promise<any>\nexport async function lazyPostCSS(\n rootDirectory: string,\n supportedBrowsers: string[] | undefined,\n disablePostcssPresetEnv: boolean | undefined,\n useLightningcss: boolean | undefined\n) {\n if (!postcssInstancePromise) {\n postcssInstancePromise = (async () => {\n const postcss = require('postcss') as typeof import('postcss')\n // @ts-ignore backwards compat\n postcss.plugin = function postcssPlugin(name, initializer) {\n function creator(...args: any) {\n let transformer = initializer(...args)\n transformer.postcssPlugin = name\n // transformer.postcssVersion = new Processor().version\n return transformer\n }\n\n let cache: any\n Object.defineProperty(creator, 'postcss', {\n get() {\n if (!cache) cache = creator()\n return cache\n },\n })\n\n creator.process = function (\n css: any,\n processOpts: any,\n pluginOpts: any\n ) {\n return postcss([creator(pluginOpts)]).process(css, processOpts)\n }\n\n return creator\n }\n\n // @ts-ignore backwards compat\n postcss.vendor = {\n /**\n * Returns the vendor prefix extracted from an input string.\n *\n * @example\n * postcss.vendor.prefix('-moz-tab-size') //=> '-moz-'\n * postcss.vendor.prefix('tab-size') //=> ''\n */\n prefix: function prefix(prop: string): string {\n const match = prop.match(/^(-\\w+-)/)\n\n if (match) {\n return match[0]\n }\n\n return ''\n },\n\n /**\n * Returns the input string stripped of its vendor prefix.\n *\n * @example\n * postcss.vendor.unprefixed('-moz-tab-size') //=> 'tab-size'\n */\n unprefixed: function unprefixed(\n /**\n * String with or without vendor prefix.\n */\n prop: string\n ): string {\n return prop.replace(/^-\\w+-/, '')\n },\n }\n\n const postCssPlugins = await getPostCssPlugins(\n rootDirectory,\n supportedBrowsers,\n disablePostcssPresetEnv,\n useLightningcss\n )\n\n return {\n postcss,\n postcssWithPlugins: postcss(postCssPlugins),\n }\n })()\n }\n\n return postcssInstancePromise\n}\n\nexport const css = curry(async function css(\n ctx: ConfigurationContext,\n config: webpack.Configuration\n) {\n const isRspack = Boolean(process.env.NEXT_RSPACK)\n const {\n prependData: sassPrependData,\n additionalData: sassAdditionalData,\n implementation: sassImplementation,\n ...sassOptions\n } = ctx.sassOptions\n\n const lazyPostCSSInitializer = () =>\n lazyPostCSS(\n ctx.rootDirectory,\n ctx.supportedBrowsers,\n ctx.experimental.disablePostcssPresetEnv,\n ctx.experimental.useLightningcss\n )\n\n const sassPreprocessors: webpack.RuleSetUseItem[] = [\n // First, process files with `sass-loader`: this inlines content, and\n // compiles away the proprietary syntax.\n {\n loader: require.resolve('next/dist/compiled/sass-loader'),\n options: {\n implementation: sassImplementation,\n // Source maps are required so that `resolve-url-loader` can locate\n // files original to their source directory.\n sourceMap: true,\n sassOptions,\n additionalData: sassPrependData || sassAdditionalData,\n },\n },\n // Then, `sass-loader` will have passed-through CSS imports as-is instead\n // of inlining them. Because they were inlined, the paths are no longer\n // correct.\n // To fix this, we use `resolve-url-loader` to rewrite the CSS\n // imports to real file paths.\n {\n loader: require.resolve('../../../loaders/resolve-url-loader/index'),\n options: {\n postcss: lazyPostCSSInitializer,\n // Source maps are not required here, but we may as well emit\n // them.\n sourceMap: true,\n },\n },\n ]\n\n const fns: ConfigurationFn[] = []\n\n const googleLoader = require.resolve(\n 'next/dist/compiled/@next/font/google/loader'\n )\n const localLoader = require.resolve(\n 'next/dist/compiled/@next/font/local/loader'\n )\n const nextFontLoaders: Array<[string | RegExp, string, any?]> = [\n [require.resolve('next/font/google/target.css'), googleLoader],\n [require.resolve('next/font/local/target.css'), localLoader],\n ]\n\n nextFontLoaders.forEach(([fontLoaderTarget, fontLoaderPath]) => {\n // Matches the resolved font loaders noop files to run next-font-loader\n fns.push(\n loader({\n oneOf: [\n markRemovable({\n sideEffects: false,\n test: fontLoaderTarget,\n use: getNextFontLoader(ctx, lazyPostCSSInitializer, fontLoaderPath),\n }),\n ],\n })\n )\n })\n\n // CSS cannot be imported in _document. This comes before everything because\n // global CSS nor CSS modules work in said file.\n fns.push(\n loader({\n oneOf: [\n markRemovable({\n test: regexLikeCss,\n // Use a loose regex so we don't have to crawl the file system to\n // find the real file name (if present).\n issuer: /pages[\\\\/]_document\\./,\n use: {\n loader: 'error-loader',\n options: {\n reason: getCustomDocumentError(),\n },\n },\n }),\n ],\n })\n )\n\n const shouldIncludeExternalCSSImports =\n !!ctx.experimental.craCompat || !!ctx.transpilePackages\n\n // CSS modules & SASS modules support. They are allowed to be imported in anywhere.\n fns.push(\n // CSS Modules should never have side effects. This setting will\n // allow unused CSS to be removed from the production build.\n // We ensure this by disallowing `:global()` CSS at the top-level\n // via the `pure` mode in `css-loader`.\n loader({\n oneOf: [\n // For app dir, we need to match the specific app layer.\n ctx.hasAppDir\n ? markRemovable({\n sideEffects: true,\n test: regexCssModules,\n issuerLayer: APP_LAYER_RULE,\n use: [\n {\n loader: require.resolve(\n '../../../loaders/next-flight-css-loader'\n ),\n options: {\n cssModules: true,\n },\n },\n ...getCssModuleLoader(\n { ...ctx, isAppDir: true },\n lazyPostCSSInitializer\n ),\n ],\n })\n : null,\n markRemovable({\n sideEffects: true,\n test: regexCssModules,\n issuerLayer: PAGES_LAYER_RULE,\n use: getCssModuleLoader(\n { ...ctx, isAppDir: false },\n lazyPostCSSInitializer\n ),\n }),\n ].filter(nonNullable),\n }),\n // Opt-in support for Sass (using .scss or .sass extensions).\n // Sass Modules should never have side effects. This setting will\n // allow unused Sass to be removed from the production build.\n // We ensure this by disallowing `:global()` Sass at the top-level\n // via the `pure` mode in `css-loader`.\n loader({\n oneOf: [\n // For app dir, we need to match the specific app layer.\n ctx.hasAppDir\n ? markRemovable({\n sideEffects: true,\n test: regexSassModules,\n issuerLayer: APP_LAYER_RULE,\n use: [\n {\n loader: require.resolve(\n '../../../loaders/next-flight-css-loader'\n ),\n options: {\n cssModules: true,\n },\n },\n ...getCssModuleLoader(\n { ...ctx, isAppDir: true },\n lazyPostCSSInitializer,\n sassPreprocessors\n ),\n ],\n })\n : null,\n markRemovable({\n sideEffects: true,\n test: regexSassModules,\n issuerLayer: PAGES_LAYER_RULE,\n use: getCssModuleLoader(\n { ...ctx, isAppDir: false },\n lazyPostCSSInitializer,\n sassPreprocessors\n ),\n }),\n ].filter(nonNullable),\n }),\n // Throw an error for CSS Modules used outside their supported scope\n loader({\n oneOf: [\n markRemovable({\n test: [regexCssModules, regexSassModules],\n use: {\n loader: 'error-loader',\n options: {\n reason: getLocalModuleImportError(),\n },\n },\n }),\n ],\n })\n )\n\n // Global CSS and SASS support.\n if (ctx.isServer) {\n fns.push(\n loader({\n oneOf: [\n ctx.hasAppDir && !ctx.isProduction\n ? markRemovable({\n sideEffects: true,\n test: [regexCssGlobal, regexSassGlobal],\n issuerLayer: APP_LAYER_RULE,\n use: {\n loader: require.resolve(\n '../../../loaders/next-flight-css-loader'\n ),\n options: {\n cssModules: false,\n },\n },\n })\n : null,\n markRemovable({\n // CSS imports have side effects, even on the server side.\n sideEffects: true,\n test: [regexCssGlobal, regexSassGlobal],\n use: require.resolve('next/dist/compiled/ignore-loader'),\n }),\n ].filter(nonNullable),\n })\n )\n } else {\n // External CSS files are allowed to be loaded when any of the following is true:\n // - hasAppDir: all CSS files are allowed\n // - If the CSS file is located in `node_modules`\n // - If the CSS file is located in another package in a monorepo (outside of the current rootDir)\n // - If the issuer is pages/_app (matched later)\n const allowedPagesGlobalCSSPath = ctx.hasAppDir\n ? undefined\n : {\n and: [\n {\n or: [\n /node_modules/,\n {\n not: [ctx.rootDirectory],\n },\n ],\n },\n ],\n }\n const allowedPagesGlobalCSSIssuer = ctx.hasAppDir\n ? undefined\n : shouldIncludeExternalCSSImports\n ? undefined\n : {\n and: [ctx.rootDirectory],\n not: [/node_modules/],\n }\n\n fns.push(\n loader({\n oneOf: [\n ...(ctx.hasAppDir\n ? [\n markRemovable({\n sideEffects: true,\n test: regexCssGlobal,\n issuerLayer: APP_LAYER_RULE,\n use: [\n {\n loader: require.resolve(\n '../../../loaders/next-flight-css-loader'\n ),\n options: {\n cssModules: false,\n },\n },\n ...getGlobalCssLoader(\n { ...ctx, isAppDir: true },\n lazyPostCSSInitializer\n ),\n ],\n }),\n markRemovable({\n sideEffects: true,\n test: regexSassGlobal,\n issuerLayer: APP_LAYER_RULE,\n use: [\n {\n loader: require.resolve(\n '../../../loaders/next-flight-css-loader'\n ),\n options: {\n cssModules: false,\n },\n },\n ...getGlobalCssLoader(\n { ...ctx, isAppDir: true },\n lazyPostCSSInitializer,\n sassPreprocessors\n ),\n ],\n }),\n ]\n : []),\n markRemovable({\n sideEffects: true,\n test: regexCssGlobal,\n include: allowedPagesGlobalCSSPath,\n issuer: allowedPagesGlobalCSSIssuer,\n issuerLayer: PAGES_LAYER_RULE,\n use: getGlobalCssLoader(\n { ...ctx, isAppDir: false },\n lazyPostCSSInitializer\n ),\n }),\n markRemovable({\n sideEffects: true,\n test: regexSassGlobal,\n include: allowedPagesGlobalCSSPath,\n issuer: allowedPagesGlobalCSSIssuer,\n issuerLayer: PAGES_LAYER_RULE,\n use: getGlobalCssLoader(\n { ...ctx, isAppDir: false },\n lazyPostCSSInitializer,\n sassPreprocessors\n ),\n }),\n ].filter(nonNullable),\n })\n )\n\n if (ctx.customAppFile) {\n fns.push(\n loader({\n oneOf: [\n markRemovable({\n sideEffects: true,\n test: regexCssGlobal,\n issuer: { and: [ctx.customAppFile] },\n use: getGlobalCssLoader(\n { ...ctx, isAppDir: false },\n lazyPostCSSInitializer\n ),\n }),\n ],\n }),\n loader({\n oneOf: [\n markRemovable({\n sideEffects: true,\n test: regexSassGlobal,\n issuer: { and: [ctx.customAppFile] },\n use: getGlobalCssLoader(\n { ...ctx, isAppDir: false },\n lazyPostCSSInitializer,\n sassPreprocessors\n ),\n }),\n ],\n })\n )\n }\n }\n\n // Throw an error for Global CSS used inside of `node_modules`\n if (!shouldIncludeExternalCSSImports) {\n fns.push(\n loader({\n oneOf: [\n markRemovable({\n test: [regexCssGlobal, regexSassGlobal],\n issuer: { and: [/node_modules/] },\n use: {\n loader: 'error-loader',\n options: {\n reason: getGlobalModuleImportError(),\n },\n },\n }),\n ],\n })\n )\n }\n\n // Throw an error for Global CSS used outside of our custom <App> file\n fns.push(\n loader({\n oneOf: [\n markRemovable({\n test: [regexCssGlobal, regexSassGlobal],\n issuer: ctx.hasAppDir\n ? {\n // If it's inside the app dir, but not importing from a layout file,\n // throw an error.\n and: [ctx.rootDirectory],\n not: [/layout\\.(js|mjs|jsx|ts|tsx)$/],\n }\n : undefined,\n use: {\n loader: 'error-loader',\n options: {\n reason: getGlobalImportError(),\n },\n },\n }),\n ],\n })\n )\n\n if (ctx.isClient) {\n // Automatically transform references to files (i.e. url()) into URLs\n // e.g. url(./logo.svg)\n fns.push(\n loader({\n oneOf: [\n markRemovable({\n // This should only be applied to CSS files\n issuer: regexLikeCss,\n // Exclude extensions that webpack handles by default\n exclude: [\n /\\.(js|mjs|jsx|ts|tsx)$/,\n /\\.html$/,\n /\\.json$/,\n /\\.webpack\\[[^\\]]+\\]$/,\n ],\n // `asset/resource` always emits a URL reference, where `asset`\n // might inline the asset as a data URI\n type: 'asset/resource',\n }),\n ],\n })\n )\n }\n\n // Enable full mini-css-extract-plugin hmr for prod mode pages or app dir\n if (ctx.isClient && (ctx.isProduction || ctx.hasAppDir)) {\n // Extract CSS as CSS file(s) in the client-side production bundle.\n const MiniCssExtractPlugin = isRspack\n ? getRspackCore().CssExtractRspackPlugin\n : (\n require('../../../plugins/mini-css-extract-plugin') as typeof import('../../../plugins/mini-css-extract-plugin')\n ).default\n\n fns.push(\n plugin(\n // @ts-ignore webpack 5 compat\n new MiniCssExtractPlugin({\n filename: ctx.isProduction\n ? 'static/css/[contenthash].css'\n : 'static/css/[name].css',\n chunkFilename: ctx.isProduction\n ? 'static/css/[contenthash].css'\n : 'static/css/[name].css',\n // Next.js guarantees that CSS order \"doesn't matter\", due to imposed\n // restrictions:\n // 1. Global CSS can only be defined in a single entrypoint (_app)\n // 2. CSS Modules generate scoped class names by default and cannot\n // include Global CSS (:global() selector).\n //\n // While not a perfect guarantee (e.g. liberal use of `:global()`\n // selector), this assumption is required to code-split CSS.\n //\n // If this warning were to trigger, it'd be unactionable by the user,\n // but likely not valid -- so we disable it.\n ignoreOrder: true,\n insert: function (linkTag: HTMLLinkElement) {\n if (typeof _N_E_STYLE_LOAD === 'function') {\n const { href, onload, onerror } = linkTag\n _N_E_STYLE_LOAD(\n href.indexOf(window.location.origin) === 0\n ? new URL(href).pathname\n : href\n ).then(\n () => onload?.call(linkTag, { type: 'load' } as Event),\n () => onerror?.call(linkTag, {} as Event)\n )\n } else {\n document.head.appendChild(linkTag)\n }\n },\n })\n )\n )\n }\n\n const fn = pipe(...fns)\n return fn(config)\n})\n"],"names":["css","lazyPostCSS","regexLikeCss","regexCssGlobal","regexCssModules","regexSassGlobal","regexSassModules","APP_LAYER_RULE","or","WEBPACK_LAYERS","reactServerComponents","serverSideRendering","appPagesBrowser","PAGES_LAYER_RULE","not","markRemovable","r","Object","defineProperty","Symbol","for","enumerable","value","postcssInstancePromise","rootDirectory","supportedBrowsers","disablePostcssPresetEnv","useLightningcss","postcss","require","plugin","postcssPlugin","name","initializer","creator","args","transformer","cache","get","process","processOpts","pluginOpts","vendor","prefix","prop","match","unprefixed","replace","postCssPlugins","getPostCssPlugins","postcssWithPlugins","curry","ctx","config","isRspack","Boolean","env","NEXT_RSPACK","prependData","sassPrependData","additionalData","sassAdditionalData","implementation","sassImplementation","sassOptions","lazyPostCSSInitializer","experimental","sassPreprocessors","loader","resolve","options","sourceMap","fns","googleLoader","localLoader","nextFontLoaders","forEach","fontLoaderTarget","fontLoaderPath","push","oneOf","sideEffects","test","use","getNextFontLoader","issuer","reason","getCustomDocumentError","shouldIncludeExternalCSSImports","craCompat","transpilePackages","hasAppDir","issuerLayer","cssModules","getCssModuleLoader","isAppDir","filter","nonNullable","getLocalModuleImportError","isServer","isProduction","allowedPagesGlobalCSSPath","undefined","and","allowedPagesGlobalCSSIssuer","getGlobalCssLoader","include","customAppFile","getGlobalModuleImportError","getGlobalImportError","isClient","exclude","type","MiniCssExtractPlugin","getRspackCore","CssExtractRspackPlugin","default","filename","chunkFilename","ignoreOrder","insert","linkTag","_N_E_STYLE_LOAD","href","onload","onerror","indexOf","window","location","origin","URL","pathname","then","call","document","head","appendChild","fn","pipe"],"mappings":";;;;;;;;;;;;;;;;IAkJaA,GAAG;eAAHA;;IAzFSC,WAAW;eAAXA;;IAtCTC,YAAY;eAAZA;;;oEAnBK;yBAEa;uBACV;yBAEkC;0BACrB;0BAM3B;yBAC2B;6BACN;2BACG;2BACD;;;;;;AAGvB,MAAMA,eAAe;AAE5B,2BAA2B;AAC3B,MAAMC,iBAAiB;AACvB,MAAMC,kBAAkB;AAExB,iDAAiD;AACjD,MAAMC,kBAAkB;AACxB,MAAMC,mBAAmB;AAEzB,MAAMC,iBAAiB;IACrBC,IAAI;QACFC,yBAAc,CAACC,qBAAqB;QACpCD,yBAAc,CAACE,mBAAmB;QAClCF,yBAAc,CAACG,eAAe;KAC/B;AACH;AAEA,MAAMC,mBAAmB;IACvBC,KAAK;QACHL,yBAAc,CAACC,qBAAqB;QACpCD,yBAAc,CAACE,mBAAmB;QAClCF,yBAAc,CAACG,eAAe;KAC/B;AACH;AAEA;;CAEC,GACD,SAASG,cAAcC,CAAsB;IAC3CC,OAAOC,cAAc,CAACF,GAAGG,OAAOC,GAAG,CAAC,sBAAsB;QACxDC,YAAY;QACZC,OAAO;IACT;IACA,OAAON;AACT;AAEA,IAAIO;AACG,eAAetB,YACpBuB,aAAqB,EACrBC,iBAAuC,EACvCC,uBAA4C,EAC5CC,eAAoC;IAEpC,IAAI,CAACJ,wBAAwB;QAC3BA,yBAAyB,AAAC,CAAA;YACxB,MAAMK,UA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CAACZ,SAAS,CAAC;gBAElC,OAAO;oBACLa,SAASC,IAAI,CAACC,WAAW,CAACf;gBAC5B;YACF;QACF;IAGN;IAEA,MAAMgB,KAAKC,IAAAA,WAAI,KAAIlE;IACnB,OAAOiE,GAAGpF;AACZ","ignoreList":[0]}
|
|
@@ -1702,7 +1702,7 @@ async function getBaseWebpackConfig(dir, { buildId, encryptionKey, config, compi
|
|
|
1702
1702
|
isClient && new _copyfileplugin.CopyFilePlugin({
|
|
1703
1703
|
// file path to build output of `@next/polyfill-nomodule`
|
|
1704
1704
|
filePath: require.resolve('./polyfills/polyfill-nomodule'),
|
|
1705
|
-
cacheKey: "15.6.0-canary.
|
|
1705
|
+
cacheKey: "15.6.0-canary.52",
|
|
1706
1706
|
name: `static/chunks/polyfills${dev ? '' : '-[hash]'}.js`,
|
|
1707
1707
|
minimize: false,
|
|
1708
1708
|
info: {
|
|
@@ -1885,7 +1885,7 @@ async function getBaseWebpackConfig(dir, { buildId, encryptionKey, config, compi
|
|
|
1885
1885
|
// - Next.js location on disk (some loaders use absolute paths and some resolve options depend on absolute paths)
|
|
1886
1886
|
// - Next.js version
|
|
1887
1887
|
// - next.config.js keys that affect compilation
|
|
1888
|
-
version: `${__dirname}|${"15.6.0-canary.
|
|
1888
|
+
version: `${__dirname}|${"15.6.0-canary.52"}|${configVars}`,
|
|
1889
1889
|
cacheDirectory: _path.default.join(distDir, 'cache', 'webpack'),
|
|
1890
1890
|
// For production builds, it's more efficient to compress all cache files together instead of compression each one individually.
|
|
1891
1891
|
// So we disable compression here and allow the build runner to take care of compressing the cache as a whole.
|
|
@@ -15,7 +15,7 @@ Object.defineProperty(exports, "appBootstrap", {
|
|
|
15
15
|
});
|
|
16
16
|
const _assetprefix = require("./asset-prefix");
|
|
17
17
|
const _setattributesfromprops = require("./set-attributes-from-props");
|
|
18
|
-
const version = "15.6.0-canary.
|
|
18
|
+
const version = "15.6.0-canary.52";
|
|
19
19
|
window.next = {
|
|
20
20
|
version,
|
|
21
21
|
appDir: true
|
package/dist/client/index.js
CHANGED
|
@@ -61,7 +61,7 @@ const _hooksclientcontextsharedruntime = require("../shared/lib/hooks-client-con
|
|
|
61
61
|
const _onrecoverableerror = require("./react-client-callbacks/on-recoverable-error");
|
|
62
62
|
const _tracer = /*#__PURE__*/ _interop_require_default._(require("./tracing/tracer"));
|
|
63
63
|
const _isnextroutererror = require("./components/is-next-router-error");
|
|
64
|
-
const version = "15.6.0-canary.
|
|
64
|
+
const version = "15.6.0-canary.52";
|
|
65
65
|
let router;
|
|
66
66
|
const emitter = (0, _mitt.default)();
|
|
67
67
|
const looseToArray = (input)=>[].slice.call(input);
|