chore(deno): add deno 2.0 support

This commit is contained in:
xfy
2024-10-12 13:47:33 +08:00
parent f0b91cf14b
commit 5c55bb1c75
2 changed files with 5703 additions and 2 deletions

5695
deno.lock generated Normal file

File diff suppressed because it is too large Load Diff

View File

@ -4,6 +4,12 @@
// enabled: process.env.ANALYZE === 'true', // enabled: process.env.ANALYZE === 'true',
// }); // });
const urlLoaderPath = 'url-loader';
const urlLoaderPathUrl = new URL(urlLoaderPath, import.meta.url).href;
const fileLoaderPath = 'file-loader';
const fileLoaderPathUrl = new URL(fileLoaderPath, import.meta.url).href;
/** /**
* @type {import('next').NextConfig} * @type {import('next').NextConfig}
*/ */
@ -38,10 +44,10 @@ const nextConfig = {
exclude: config.exclude, exclude: config.exclude,
use: [ use: [
{ {
loader: require.resolve('url-loader'), loader: urlLoaderPathUrl,
options: { options: {
limit: config.inlineImageLimit, limit: config.inlineImageLimit,
fallback: require.resolve('file-loader'), fallback: fileLoaderPathUrl,
publicPath: `${config.assetPrefix}/_next/static/images/`, publicPath: `${config.assetPrefix}/_next/static/images/`,
outputPath: `${isServer ? '../' : ''}static/images/`, outputPath: `${isServer ? '../' : ''}static/images/`,
name: '[name]-[hash].[ext]', name: '[name]-[hash].[ext]',