Skip to content
This repository was archived by the owner on Jul 6, 2025. It is now read-only.

Commit 011eb5e

Browse files
committed
refactor: add bundler dir
1 parent c67d608 commit 011eb5e

File tree

6 files changed

+5
-8
lines changed

6 files changed

+5
-8
lines changed

server/bundler.ts renamed to bundler/mod.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,16 @@ import * as path from 'https://deno.land/[email protected]/path/mod.ts'
33
import { ensureDir } from 'https://deno.land/[email protected]/fs/ensure_dir.ts'
44
import { parseExportNames, transform } from '../compiler/mod.ts'
55
import { trimModuleExt } from '../framework/core/module.ts'
6-
import { defaultReactVersion, defaultReactEsmShBuildVersion } from '../shared/constants.ts'
76
import { ensureTextFile, existsFileSync, lazyRemove } from '../shared/fs.ts'
87
import log from '../shared/log.ts'
98
import util from '../shared/util.ts'
109
import { VERSION } from '../version.ts'
11-
import type { Application, Module } from './app.ts'
10+
import type { Application, Module } from '../server/app.ts'
1211
import {
1312
clearCompilation,
1413
computeHash,
1514
getAlephPkgUri,
16-
isLoaderPlugin
17-
} from './helper.ts'
15+
} from '../server/helper.ts'
1816

1917
export const bundlerRuntimeCode = (`
2018
window.__ALEPH = {
@@ -211,7 +209,7 @@ export class Bundler {
211209
const bundleFilename = `polyfill.bundle.${hash.slice(0, 8)}.js`
212210
const bundleFile = path.join(this.#app.buildDir, bundleFilename)
213211
if (!existsFileSync(bundleFile)) {
214-
const rawPolyfillFile = `${alephPkgUri}/compiler/polyfills/${buildTarget}/mod.ts`
212+
const rawPolyfillFile = `${alephPkgUri}/bundler/polyfills/${buildTarget}/mod.ts`
215213
await this._bundle(rawPolyfillFile, bundleFile)
216214
}
217215
this.#bundledFiles.set('polyfill', bundleFilename)
File renamed without changes.

server/app.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import {
99
join,
1010
resolve
1111
} from 'https://deno.land/[email protected]/path/mod.ts'
12-
import { CSSProcessor } from '../compiler/css.ts'
12+
import { Bundler, bundlerRuntimeCode } from '../bundler/mod.ts'
1313
import {
1414
buildChecksum,
1515
ImportMap,
@@ -23,7 +23,6 @@ import { moduleExts, toPagePath, trimModuleExt } from '../framework/core/module.
2323
import { RouteModule, Routing } from '../framework/core/routing.ts'
2424
import {
2525
defaultReactEsmShBuildVersion, defaultReactVersion,
26-
2726
minDenoVersion
2827
} from '../shared/constants.ts'
2928
import {
@@ -39,8 +38,8 @@ import type {
3938
ServerApplication
4039
} from '../types.ts'
4140
import { VERSION } from '../version.ts'
42-
import { Bundler, bundlerRuntimeCode } from './bundler.ts'
4341
import { defaultConfig, loadConfig, loadImportMap } from './config.ts'
42+
import { CSSProcessor } from './css.ts'
4443
import {
4544
computeHash,
4645
formatBytesWithColor,
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)