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

View File

@ -4,6 +4,12 @@
// 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}
*/
@ -38,10 +44,10 @@ const nextConfig = {
exclude: config.exclude,
use: [
{
loader: require.resolve('url-loader'),
loader: urlLoaderPathUrl,
options: {
limit: config.inlineImageLimit,
fallback: require.resolve('file-loader'),
fallback: fileLoaderPathUrl,
publicPath: `${config.assetPrefix}/_next/static/images/`,
outputPath: `${isServer ? '../' : ''}static/images/`,
name: '[name]-[hash].[ext]',