mirror of
https://github.com/nuxt/nuxt.git
synced 2025-01-18 17:35:57 +00:00
refactor: use # prefex for internal aliases
leftovers
This commit is contained in:
parent
98a0c727c9
commit
3398d5a7d6
@ -189,7 +189,7 @@ export const getRollupConfig = (nitroContext: NitroContext) => {
|
||||
|
||||
// Polyfill
|
||||
rollupConfig.plugins.push(virtual({
|
||||
'~polyfill': env.polyfill.map(p => `import '${p}';`).join('\n')
|
||||
'#polyfill': env.polyfill.map(p => `import '${p}';`).join('\n')
|
||||
}))
|
||||
|
||||
// https://github.com/rollup/plugins/tree/master/packages/alias
|
||||
|
@ -12,7 +12,7 @@ export function middleware (getMiddleware: () => ServerMiddleware[]) {
|
||||
let lastDump = ''
|
||||
|
||||
return virtual({
|
||||
'~serverMiddleware': {
|
||||
'#server-middleware': {
|
||||
load: () => {
|
||||
const middleware = getMiddleware()
|
||||
|
||||
|
@ -28,11 +28,11 @@ export function staticAssets (context: NitroContext) {
|
||||
}
|
||||
|
||||
return virtual({
|
||||
'~static-assets': `export default ${JSON.stringify(assets, null, 2)};`,
|
||||
'~static': `
|
||||
'#static-assets': `export default ${JSON.stringify(assets, null, 2)};`,
|
||||
'#static': `
|
||||
import { promises } from 'fs'
|
||||
import { resolve } from 'path'
|
||||
import assets from '~static-assets'
|
||||
import assets from '#static-assets'
|
||||
|
||||
export function readAsset (id) {
|
||||
return promises.readFile(resolve(mainDir, getAsset(id).path))
|
||||
|
@ -1,4 +1,4 @@
|
||||
import '~polyfill'
|
||||
import '#polyfill'
|
||||
import { parseURL } from 'ufo'
|
||||
import { localCall } from '../server'
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
import '~polyfill'
|
||||
import '#polyfill'
|
||||
import { localCall } from '../server'
|
||||
|
||||
export default async function handle (context, req) {
|
||||
|
@ -1,4 +1,4 @@
|
||||
import '~polyfill'
|
||||
import '#polyfill'
|
||||
import { localCall } from '../server'
|
||||
|
||||
async function cli () {
|
||||
|
@ -1,4 +1,4 @@
|
||||
import '~polyfill'
|
||||
import '#polyfill'
|
||||
import { getAssetFromKV } from '@cloudflare/kv-asset-handler'
|
||||
import { localCall } from '../server'
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
import '~polyfill'
|
||||
import '#polyfill'
|
||||
import { Server } from 'http'
|
||||
import { parentPort } from 'worker_threads'
|
||||
import type { AddressInfo } from 'net'
|
||||
|
@ -1,4 +1,4 @@
|
||||
import '~polyfill'
|
||||
import '#polyfill'
|
||||
|
||||
import { handle } from '../server'
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
import '~polyfill'
|
||||
import '#polyfill'
|
||||
import { withQuery } from 'ufo'
|
||||
import { localCall } from '../server'
|
||||
|
||||
|
@ -1,2 +1,2 @@
|
||||
import '~polyfill'
|
||||
import '#polyfill'
|
||||
export * from '../server'
|
||||
|
@ -1,4 +1,4 @@
|
||||
import '~polyfill'
|
||||
import '#polyfill'
|
||||
import { Server } from 'http'
|
||||
import destr from 'destr'
|
||||
import { handle } from '../server'
|
||||
|
@ -1,5 +1,5 @@
|
||||
// @ts-nocheck
|
||||
import '~polyfill'
|
||||
import '#polyfill'
|
||||
import { localCall } from '../server'
|
||||
|
||||
addEventListener('fetch', (event: any) => {
|
||||
|
@ -1,4 +1,4 @@
|
||||
import '~polyfill'
|
||||
import '#polyfill'
|
||||
import { handle } from '../server'
|
||||
|
||||
export default handle
|
||||
|
@ -6,7 +6,7 @@ import { createCall, createFetch as createLocalFetch } from 'unenv/runtime/fetch
|
||||
import { timingMiddleware } from './timing'
|
||||
import { handleError } from './error'
|
||||
// @ts-ignore
|
||||
import serverMiddleware from '~serverMiddleware'
|
||||
import serverMiddleware from '#server-middleware'
|
||||
|
||||
const app = createApp({
|
||||
debug: destr(process.env.DEBUG),
|
||||
|
@ -1,7 +1,7 @@
|
||||
import { createError } from 'h3'
|
||||
import { withoutTrailingSlash, withLeadingSlash, parseURL } from 'ufo'
|
||||
// @ts-ignore
|
||||
import { getAsset, readAsset } from '~static'
|
||||
import { getAsset, readAsset } from '#static'
|
||||
|
||||
const METHODS = ['HEAD', 'GET']
|
||||
const PUBLIC_PATH = process.env.PUBLIC_PATH // Default: /_nuxt/
|
||||
|
Loading…
Reference in New Issue
Block a user