next 16.0.0-canary.5 → 16.0.0-canary.6
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/index.js +4 -4
- package/dist/build/index.js.map +1 -1
- package/dist/build/swc/generated-native.d.ts +6 -6
- package/dist/build/swc/index.js +1 -1
- package/dist/build/templates/app-page.js +5 -6
- package/dist/build/templates/app-page.js.map +1 -1
- package/dist/build/webpack-config-rules/resolve.d.ts +1 -1
- package/dist/build/webpack-config-rules/resolve.js +8 -9
- package/dist/build/webpack-config-rules/resolve.js.map +1 -1
- package/dist/build/webpack-config.js +23 -16
- 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 +4 -4
- package/dist/esm/build/index.js.map +1 -1
- package/dist/esm/build/swc/generated-native.d.ts +6 -6
- package/dist/esm/build/swc/index.js +1 -1
- package/dist/esm/build/templates/app-page.js +5 -6
- package/dist/esm/build/templates/app-page.js.map +1 -1
- package/dist/esm/build/webpack-config-rules/resolve.js +5 -7
- package/dist/esm/build/webpack-config-rules/resolve.js.map +1 -1
- package/dist/esm/build/webpack-config.js +24 -17
- 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-schema.js +0 -1
- package/dist/esm/server/config-schema.js.map +1 -1
- package/dist/esm/server/config-shared.js +0 -1
- package/dist/esm/server/config-shared.js.map +1 -1
- package/dist/esm/server/config.js +5 -29
- package/dist/esm/server/config.js.map +1 -1
- package/dist/esm/server/dev/hot-reloader-turbopack.js +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/esm/shared/lib/errors/canary-only-config-error.js +1 -1
- package/dist/server/config-schema.d.ts +0 -1
- package/dist/server/config-schema.js +0 -1
- package/dist/server/config-schema.js.map +1 -1
- package/dist/server/config-shared.d.ts +0 -7
- package/dist/server/config-shared.js +0 -1
- package/dist/server/config-shared.js.map +1 -1
- package/dist/server/config.js +5 -29
- package/dist/server/config.js.map +1 -1
- package/dist/server/dev/hot-reloader-turbopack.js +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/shared/lib/errors/canary-only-config-error.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
|
@@ -35,7 +35,7 @@ import { MemoryWithGcCachePlugin } from './webpack/plugins/memory-with-gc-cache-
|
|
|
35
35
|
import { getBabelConfigFile } from './get-babel-config-file';
|
|
36
36
|
import { needsExperimentalReact } from '../lib/needs-experimental-react';
|
|
37
37
|
import { isResourceInPackages, makeExternalHandler } from './handle-externals';
|
|
38
|
-
import { getMainField,
|
|
38
|
+
import { getMainField, edgeConditionName } from './webpack-config-rules/resolve';
|
|
39
39
|
import { OptionalPeerDependencyResolverPlugin } from './webpack/plugins/optional-peer-dependency-resolve-plugin';
|
|
40
40
|
import { createWebpackAliases, createServerOnlyClientOnlyAliases, createVendoredReactAliases, createNextApiEsmAliases, createAppRouterApiAliases } from './create-compiler-aliases';
|
|
41
41
|
import { hasCustomExportOutput } from '../export/utils';
|
|
@@ -204,9 +204,9 @@ export function getCacheDirectories(configs) {
|
|
|
204
204
|
}).filter((dir)=>dir != null));
|
|
205
205
|
}
|
|
206
206
|
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, isCompileMode, previewProps }) {
|
|
207
|
-
var _config_compiler, _config_compiler1, _config_compiler2, _jsConfig_compilerOptions, _config_compiler3, _jsConfig_compilerOptions1, _config_compiler4,
|
|
207
|
+
var _config_experimental, _config_compiler, _config_compiler1, _config_compiler2, _jsConfig_compilerOptions, _config_compiler3, _jsConfig_compilerOptions1, _config_compiler4, _config_experimental1, _config_watchOptions, _config_experimental_sri, _config_experimental_sri1, _jsConfig_compilerOptions2, // always add JsConfigPathsPlugin to allow hot-reloading
|
|
208
208
|
// if the config is added/removed
|
|
209
|
-
_webpackConfig_resolve_plugins, _webpackConfig_resolve,
|
|
209
|
+
_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;
|
|
210
210
|
const bundler = getWebpackBundler();
|
|
211
211
|
const isClient = compilerType === COMPILER_NAMES.client;
|
|
212
212
|
const isEdgeServer = compilerType === COMPILER_NAMES.edgeServer;
|
|
@@ -433,12 +433,21 @@ export default async function getBaseWebpackConfig(dir, { buildId, encryptionKey
|
|
|
433
433
|
}) : defaultLoaders.babel;
|
|
434
434
|
const pageExtensions = config.pageExtensions;
|
|
435
435
|
const outputPath = isNodeOrEdgeCompilation ? path.join(distDir, SERVER_DIRECTORY) : distDir;
|
|
436
|
-
const
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
436
|
+
const conditionNames = [
|
|
437
|
+
...((_config_experimental = config.experimental) == null ? void 0 : _config_experimental.cacheComponents) === true ? [
|
|
438
|
+
'next-js'
|
|
439
|
+
] : [],
|
|
440
|
+
...isEdgeServer ? [
|
|
441
|
+
edgeConditionName
|
|
442
|
+
] : [],
|
|
443
|
+
// inherits Webpack's default conditions
|
|
440
444
|
'...'
|
|
441
445
|
];
|
|
446
|
+
const reactServerConditionNames = [
|
|
447
|
+
'react-server',
|
|
448
|
+
// We could just use `'...'`. Explicit spread makes it more obvious.
|
|
449
|
+
...conditionNames
|
|
450
|
+
];
|
|
442
451
|
const reactRefreshEntry = isRspack ? require.resolve(`next/dist/compiled/@next/react-refresh-utils/dist/rspack-runtime`) : require.resolve(`next/dist/compiled/@next/react-refresh-utils/dist/runtime`);
|
|
443
452
|
const clientEntries = isClient ? {
|
|
444
453
|
// Backwards compatibility
|
|
@@ -457,6 +466,7 @@ export default async function getBaseWebpackConfig(dir, { buildId, encryptionKey
|
|
|
457
466
|
} : {}
|
|
458
467
|
} : undefined;
|
|
459
468
|
const resolveConfig = {
|
|
469
|
+
conditionNames,
|
|
460
470
|
// Disable .mjs for node_modules bundling
|
|
461
471
|
extensions: [
|
|
462
472
|
'.js',
|
|
@@ -490,9 +500,6 @@ export default async function getBaseWebpackConfig(dir, { buildId, encryptionKey
|
|
|
490
500
|
} : undefined,
|
|
491
501
|
// default main fields use pages dir ones, and customize app router ones in loaders.
|
|
492
502
|
mainFields: getMainField(compilerType, false),
|
|
493
|
-
...isEdgeServer && {
|
|
494
|
-
conditionNames: edgeConditionNames
|
|
495
|
-
},
|
|
496
503
|
plugins: [
|
|
497
504
|
isNodeServer ? new OptionalPeerDependencyResolverPlugin() : undefined
|
|
498
505
|
].filter(Boolean),
|
|
@@ -875,7 +882,7 @@ export default async function getBaseWebpackConfig(dir, { buildId, encryptionKey
|
|
|
875
882
|
// Minify CSS
|
|
876
883
|
// By default, Rspack uses LightningCSS for CSS minification.
|
|
877
884
|
// Rspack uses css-minimizer-plugin by default for compatibility.
|
|
878
|
-
isRspack && (process.env.__NEXT_TEST_MODE ? config.experimental.useLightningcss : ((
|
|
885
|
+
isRspack && (process.env.__NEXT_TEST_MODE ? config.experimental.useLightningcss : ((_config_experimental1 = config.experimental) == null ? void 0 : _config_experimental1.useLightningcss) === undefined || config.experimental.useLightningcss) ? new (getRspackCore()).LightningCssMinimizerRspackPlugin({
|
|
879
886
|
// CSS minimizer configuration
|
|
880
887
|
minimizerOptions: {
|
|
881
888
|
targets: supportedBrowsers
|
|
@@ -1119,7 +1126,7 @@ export default async function getBaseWebpackConfig(dir, { buildId, encryptionKey
|
|
|
1119
1126
|
},
|
|
1120
1127
|
resolve: {
|
|
1121
1128
|
mainFields: getMainField(compilerType, true),
|
|
1122
|
-
conditionNames:
|
|
1129
|
+
conditionNames: reactServerConditionNames,
|
|
1123
1130
|
// If missing the alias override here, the default alias will be used which aliases
|
|
1124
1131
|
// react to the direct file path, not the package name. In that case the condition
|
|
1125
1132
|
// will be ignored completely.
|
|
@@ -1258,7 +1265,7 @@ export default async function getBaseWebpackConfig(dir, { buildId, encryptionKey
|
|
|
1258
1265
|
use: middlewareLayerLoaders,
|
|
1259
1266
|
resolve: {
|
|
1260
1267
|
mainFields: getMainField(compilerType, true),
|
|
1261
|
-
conditionNames:
|
|
1268
|
+
conditionNames: reactServerConditionNames,
|
|
1262
1269
|
alias: createVendoredReactAliases(bundledReactChannel, {
|
|
1263
1270
|
reactProductionProfiling,
|
|
1264
1271
|
layer: WEBPACK_LAYERS.middleware,
|
|
@@ -1273,7 +1280,7 @@ export default async function getBaseWebpackConfig(dir, { buildId, encryptionKey
|
|
|
1273
1280
|
use: instrumentLayerLoaders,
|
|
1274
1281
|
resolve: {
|
|
1275
1282
|
mainFields: getMainField(compilerType, true),
|
|
1276
|
-
conditionNames:
|
|
1283
|
+
conditionNames: reactServerConditionNames,
|
|
1277
1284
|
alias: createVendoredReactAliases(bundledReactChannel, {
|
|
1278
1285
|
reactProductionProfiling,
|
|
1279
1286
|
layer: WEBPACK_LAYERS.instrument,
|
|
@@ -1600,7 +1607,7 @@ export default async function getBaseWebpackConfig(dir, { buildId, encryptionKey
|
|
|
1600
1607
|
isClient && new CopyFilePlugin({
|
|
1601
1608
|
// file path to build output of `@next/polyfill-nomodule`
|
|
1602
1609
|
filePath: require.resolve('./polyfills/polyfill-nomodule'),
|
|
1603
|
-
cacheKey: "16.0.0-canary.
|
|
1610
|
+
cacheKey: "16.0.0-canary.6",
|
|
1604
1611
|
name: `static/chunks/polyfills${dev ? '' : '-[hash]'}.js`,
|
|
1605
1612
|
minimize: false,
|
|
1606
1613
|
info: {
|
|
@@ -1753,7 +1760,7 @@ export default async function getBaseWebpackConfig(dir, { buildId, encryptionKey
|
|
|
1753
1760
|
webpack5Config.optimization.usedExports = false;
|
|
1754
1761
|
}
|
|
1755
1762
|
const configVars = JSON.stringify({
|
|
1756
|
-
optimizePackageImports: config == null ? void 0 : (
|
|
1763
|
+
optimizePackageImports: config == null ? void 0 : (_config_experimental2 = config.experimental) == null ? void 0 : _config_experimental2.optimizePackageImports,
|
|
1757
1764
|
crossOrigin: config.crossOrigin,
|
|
1758
1765
|
pageExtensions: pageExtensions,
|
|
1759
1766
|
trailingSlash: config.trailingSlash,
|
|
@@ -1791,7 +1798,7 @@ export default async function getBaseWebpackConfig(dir, { buildId, encryptionKey
|
|
|
1791
1798
|
// - Next.js location on disk (some loaders use absolute paths and some resolve options depend on absolute paths)
|
|
1792
1799
|
// - Next.js version
|
|
1793
1800
|
// - next.config.js keys that affect compilation
|
|
1794
|
-
version: `${__dirname}|${"16.0.0-canary.
|
|
1801
|
+
version: `${__dirname}|${"16.0.0-canary.6"}|${configVars}`,
|
|
1795
1802
|
cacheDirectory: path.join(distDir, 'cache', 'webpack'),
|
|
1796
1803
|
// For production builds, it's more efficient to compress all cache files together instead of compression each one individually.
|
|
1797
1804
|
// So we disable compression here and allow the build runner to take care of compressing the cache as a whole.
|