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
|
@@ -307,9 +307,9 @@ function getCacheDirectories(configs) {
|
|
|
307
307
|
}).filter((dir)=>dir != null));
|
|
308
308
|
}
|
|
309
309
|
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 }) {
|
|
310
|
-
var _config_compiler, _config_compiler1, _config_compiler2, _jsConfig_compilerOptions, _config_compiler3, _jsConfig_compilerOptions1, _config_compiler4,
|
|
310
|
+
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
|
|
311
311
|
// if the config is added/removed
|
|
312
|
-
_webpackConfig_resolve_plugins, _webpackConfig_resolve,
|
|
312
|
+
_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;
|
|
313
313
|
const bundler = (0, _getwebpackbundler.default)();
|
|
314
314
|
const isClient = compilerType === _constants1.COMPILER_NAMES.client;
|
|
315
315
|
const isEdgeServer = compilerType === _constants1.COMPILER_NAMES.edgeServer;
|
|
@@ -536,12 +536,21 @@ async function getBaseWebpackConfig(dir, { buildId, encryptionKey, config, compi
|
|
|
536
536
|
}) : defaultLoaders.babel;
|
|
537
537
|
const pageExtensions = config.pageExtensions;
|
|
538
538
|
const outputPath = isNodeOrEdgeCompilation ? _path.default.join(distDir, _constants1.SERVER_DIRECTORY) : distDir;
|
|
539
|
-
const
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
539
|
+
const conditionNames = [
|
|
540
|
+
...((_config_experimental = config.experimental) == null ? void 0 : _config_experimental.cacheComponents) === true ? [
|
|
541
|
+
'next-js'
|
|
542
|
+
] : [],
|
|
543
|
+
...isEdgeServer ? [
|
|
544
|
+
_resolve.edgeConditionName
|
|
545
|
+
] : [],
|
|
546
|
+
// inherits Webpack's default conditions
|
|
543
547
|
'...'
|
|
544
548
|
];
|
|
549
|
+
const reactServerConditionNames = [
|
|
550
|
+
'react-server',
|
|
551
|
+
// We could just use `'...'`. Explicit spread makes it more obvious.
|
|
552
|
+
...conditionNames
|
|
553
|
+
];
|
|
545
554
|
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`);
|
|
546
555
|
const clientEntries = isClient ? {
|
|
547
556
|
// Backwards compatibility
|
|
@@ -560,6 +569,7 @@ async function getBaseWebpackConfig(dir, { buildId, encryptionKey, config, compi
|
|
|
560
569
|
} : {}
|
|
561
570
|
} : undefined;
|
|
562
571
|
const resolveConfig = {
|
|
572
|
+
conditionNames,
|
|
563
573
|
// Disable .mjs for node_modules bundling
|
|
564
574
|
extensions: [
|
|
565
575
|
'.js',
|
|
@@ -593,9 +603,6 @@ async function getBaseWebpackConfig(dir, { buildId, encryptionKey, config, compi
|
|
|
593
603
|
} : undefined,
|
|
594
604
|
// default main fields use pages dir ones, and customize app router ones in loaders.
|
|
595
605
|
mainFields: (0, _resolve.getMainField)(compilerType, false),
|
|
596
|
-
...isEdgeServer && {
|
|
597
|
-
conditionNames: _resolve.edgeConditionNames
|
|
598
|
-
},
|
|
599
606
|
plugins: [
|
|
600
607
|
isNodeServer ? new _optionalpeerdependencyresolveplugin.OptionalPeerDependencyResolverPlugin() : undefined
|
|
601
608
|
].filter(Boolean),
|
|
@@ -978,7 +985,7 @@ async function getBaseWebpackConfig(dir, { buildId, encryptionKey, config, compi
|
|
|
978
985
|
// Minify CSS
|
|
979
986
|
// By default, Rspack uses LightningCSS for CSS minification.
|
|
980
987
|
// Rspack uses css-minimizer-plugin by default for compatibility.
|
|
981
|
-
isRspack && (process.env.__NEXT_TEST_MODE ? config.experimental.useLightningcss : ((
|
|
988
|
+
isRspack && (process.env.__NEXT_TEST_MODE ? config.experimental.useLightningcss : ((_config_experimental1 = config.experimental) == null ? void 0 : _config_experimental1.useLightningcss) === undefined || config.experimental.useLightningcss) ? new ((0, _getrspack.getRspackCore)()).LightningCssMinimizerRspackPlugin({
|
|
982
989
|
// CSS minimizer configuration
|
|
983
990
|
minimizerOptions: {
|
|
984
991
|
targets: supportedBrowsers
|
|
@@ -1222,7 +1229,7 @@ async function getBaseWebpackConfig(dir, { buildId, encryptionKey, config, compi
|
|
|
1222
1229
|
},
|
|
1223
1230
|
resolve: {
|
|
1224
1231
|
mainFields: (0, _resolve.getMainField)(compilerType, true),
|
|
1225
|
-
conditionNames:
|
|
1232
|
+
conditionNames: reactServerConditionNames,
|
|
1226
1233
|
// If missing the alias override here, the default alias will be used which aliases
|
|
1227
1234
|
// react to the direct file path, not the package name. In that case the condition
|
|
1228
1235
|
// will be ignored completely.
|
|
@@ -1361,7 +1368,7 @@ async function getBaseWebpackConfig(dir, { buildId, encryptionKey, config, compi
|
|
|
1361
1368
|
use: middlewareLayerLoaders,
|
|
1362
1369
|
resolve: {
|
|
1363
1370
|
mainFields: (0, _resolve.getMainField)(compilerType, true),
|
|
1364
|
-
conditionNames:
|
|
1371
|
+
conditionNames: reactServerConditionNames,
|
|
1365
1372
|
alias: (0, _createcompileraliases.createVendoredReactAliases)(bundledReactChannel, {
|
|
1366
1373
|
reactProductionProfiling,
|
|
1367
1374
|
layer: _constants.WEBPACK_LAYERS.middleware,
|
|
@@ -1376,7 +1383,7 @@ async function getBaseWebpackConfig(dir, { buildId, encryptionKey, config, compi
|
|
|
1376
1383
|
use: instrumentLayerLoaders,
|
|
1377
1384
|
resolve: {
|
|
1378
1385
|
mainFields: (0, _resolve.getMainField)(compilerType, true),
|
|
1379
|
-
conditionNames:
|
|
1386
|
+
conditionNames: reactServerConditionNames,
|
|
1380
1387
|
alias: (0, _createcompileraliases.createVendoredReactAliases)(bundledReactChannel, {
|
|
1381
1388
|
reactProductionProfiling,
|
|
1382
1389
|
layer: _constants.WEBPACK_LAYERS.instrument,
|
|
@@ -1703,7 +1710,7 @@ async function getBaseWebpackConfig(dir, { buildId, encryptionKey, config, compi
|
|
|
1703
1710
|
isClient && new _copyfileplugin.CopyFilePlugin({
|
|
1704
1711
|
// file path to build output of `@next/polyfill-nomodule`
|
|
1705
1712
|
filePath: require.resolve('./polyfills/polyfill-nomodule'),
|
|
1706
|
-
cacheKey: "16.0.0-canary.
|
|
1713
|
+
cacheKey: "16.0.0-canary.6",
|
|
1707
1714
|
name: `static/chunks/polyfills${dev ? '' : '-[hash]'}.js`,
|
|
1708
1715
|
minimize: false,
|
|
1709
1716
|
info: {
|
|
@@ -1856,7 +1863,7 @@ async function getBaseWebpackConfig(dir, { buildId, encryptionKey, config, compi
|
|
|
1856
1863
|
webpack5Config.optimization.usedExports = false;
|
|
1857
1864
|
}
|
|
1858
1865
|
const configVars = JSON.stringify({
|
|
1859
|
-
optimizePackageImports: config == null ? void 0 : (
|
|
1866
|
+
optimizePackageImports: config == null ? void 0 : (_config_experimental2 = config.experimental) == null ? void 0 : _config_experimental2.optimizePackageImports,
|
|
1860
1867
|
crossOrigin: config.crossOrigin,
|
|
1861
1868
|
pageExtensions: pageExtensions,
|
|
1862
1869
|
trailingSlash: config.trailingSlash,
|
|
@@ -1894,7 +1901,7 @@ async function getBaseWebpackConfig(dir, { buildId, encryptionKey, config, compi
|
|
|
1894
1901
|
// - Next.js location on disk (some loaders use absolute paths and some resolve options depend on absolute paths)
|
|
1895
1902
|
// - Next.js version
|
|
1896
1903
|
// - next.config.js keys that affect compilation
|
|
1897
|
-
version: `${__dirname}|${"16.0.0-canary.
|
|
1904
|
+
version: `${__dirname}|${"16.0.0-canary.6"}|${configVars}`,
|
|
1898
1905
|
cacheDirectory: _path.default.join(distDir, 'cache', 'webpack'),
|
|
1899
1906
|
// For production builds, it's more efficient to compress all cache files together instead of compression each one individually.
|
|
1900
1907
|
// So we disable compression here and allow the build runner to take care of compressing the cache as a whole.
|