Skip to content
This repository has been archived by the owner on May 22, 2024. It is now read-only.

Commit

Permalink
refactor: remove transpilation
Browse files Browse the repository at this point in the history
  • Loading branch information
eduardoboucas committed Nov 2, 2021
1 parent 461cef1 commit 7dd8c2c
Showing 1 changed file with 1 addition and 14 deletions.
15 changes: 1 addition & 14 deletions src/runtimes/node/bundlers/nft/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@ import type { GetSrcFilesFunction } from '../../../runtime'
import { getBasePath } from '../../utils/base_path'
import { filterExcludedPaths, getPathsOfIncludedFiles } from '../../utils/included_files'

import { getPatchedESMPackages } from './es_modules'
import { transpileMany } from './transpile'

// Paths that will be excluded from the tracing process.
const ignore = ['node_modules/aws-sdk/**']

Expand Down Expand Up @@ -61,7 +58,6 @@ const ignoreFunction = (path: string) => {

const traceFilesAndTranspile = async function ({
basePath,
config,
mainFile,
pluginsModulesPath,
}: {
Expand All @@ -71,11 +67,7 @@ const traceFilesAndTranspile = async function ({
pluginsModulesPath?: string
}) {
const fsCache: FsCache = {}
const {
fileList: dependencyPaths,
esmFileList,
reasons,
} = await nodeFileTrace([mainFile], {
const { fileList: dependencyPaths } = await nodeFileTrace([mainFile], {
base: basePath,
ignore: ignoreFunction,
readFile: async (path: string) => {
Expand Down Expand Up @@ -111,14 +103,9 @@ const traceFilesAndTranspile = async function ({
const normalizedDependencyPaths = [...dependencyPaths].map((path) =>
basePath ? resolve(basePath, path) : resolve(path),
)
const esmPaths = [...esmFileList].map((path) => (basePath ? resolve(basePath, path) : resolve(path)))
const transpiledPaths = await transpileMany(esmPaths, config)
const patchedESMPackages = await getPatchedESMPackages(esmFileList, reasons, fsCache, basePath)
const rewrites = new Map([...transpiledPaths, ...patchedESMPackages])

return {
paths: normalizedDependencyPaths,
rewrites,
}
}

Expand Down

0 comments on commit 7dd8c2c

Please sign in to comment.