Skip to content

Commit

Permalink
fix: renamed variables
Browse files Browse the repository at this point in the history
  • Loading branch information
prisis committed Sep 15, 2024
1 parent 856c3c4 commit 273079e
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 9 deletions.
1 change: 1 addition & 0 deletions packages/packem/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ It uses the `exports` configuration in `package.json` and recognizes entry file
- ✅ Supports `tsconfig.json` paths and `package.json` imports resolution
- ✅ ESM ⇄ CJS interoperability
- ✅ Supports isolated declaration types (experimental)
- ✅ Supports wasm [WebAssembly modules](http://webassembly.org)

And more...

Expand Down
2 changes: 1 addition & 1 deletion packages/packem/packem.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export default defineConfig({
node10Compatibility: {
typeScriptVersion: ">=5.0",
writeToPackageJson: true,
},
}
},
transformer,
});
2 changes: 1 addition & 1 deletion packages/packem/src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,4 @@ export const ENDING_RE: RegExp = /(?:\.d\.[mc]?ts|\.\w+)$/;
export const CHUNKS_PACKEM_FOLDER = "packem_chunks";
export const SHARED_PACKEM_FOLDER = "packem_shared";

export const TYPESCRIPT_EXTENSIONS_REGEX = /\.(cjs|mjs|cts|mts|ts|tsx)$/;
export const ALLOWED_TRANSFORM_EXTENSIONS_REGEX = /\.(js|cjs|mjs|cts|mts|ts|tsx)$/;
10 changes: 5 additions & 5 deletions packages/packem/src/create-bundler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import { VERSION } from "rollup";

import build from "./build";
import type { BuildConfigFunction } from "./config";
import { DEFAULT_EXTENSIONS, EXCLUDE_REGEXP, PRODUCTION_ENV, TYPESCRIPT_EXTENSIONS_REGEX } from "./constants";
import { DEFAULT_EXTENSIONS, EXCLUDE_REGEXP, PRODUCTION_ENV, ALLOWED_TRANSFORM_EXTENSIONS_REGEX } from "./constants";
import resolvePreset from "./hooks/preset/utils/resolve-preset";
import createStub from "./jit/create-stub";
import getHash from "./rollup/utils/get-hash";
Expand Down Expand Up @@ -142,7 +142,7 @@ const generateOptions = (
},
esbuild: {
charset: "utf8",
include: TYPESCRIPT_EXTENSIONS_REGEX,
include: ALLOWED_TRANSFORM_EXTENSIONS_REGEX,
jsx: jsxRuntime,
jsxDev: tsconfig?.config.compilerOptions?.jsx === "react-jsxdev",
jsxFactory: tsconfig?.config.compilerOptions?.jsxFactory,
Expand Down Expand Up @@ -171,7 +171,7 @@ const generateOptions = (
isolatedDeclarations: {
exclude: EXCLUDE_REGEXP,
ignoreErrors: false,
include: TYPESCRIPT_EXTENSIONS_REGEX,
include: ALLOWED_TRANSFORM_EXTENSIONS_REGEX,
},
json: {
preferConst: true,
Expand Down Expand Up @@ -225,7 +225,7 @@ const generateOptions = (
disableESTransforms: true,
enableLegacyBabel5ModuleInterop: false,
enableLegacyTypeScriptModuleInterop: tsconfig?.config.compilerOptions?.esModuleInterop === false,
include: TYPESCRIPT_EXTENSIONS_REGEX,
include: ALLOWED_TRANSFORM_EXTENSIONS_REGEX,
injectCreateRequireForImportRequire: false,
preserveDynamicImport: true,
production: environment === PRODUCTION_ENV,
Expand All @@ -242,7 +242,7 @@ const generateOptions = (
}),
},
swc: {
include: TYPESCRIPT_EXTENSIONS_REGEX,
include: ALLOWED_TRANSFORM_EXTENSIONS_REGEX,
inlineSourcesContent: false,
inputSourceMap: false,
isModule: true,
Expand Down
2 changes: 1 addition & 1 deletion packages/packem/src/rollup/get-rollup-options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -425,7 +425,7 @@ export const getRollupOptions = async (context: BuildContext, fileCache: FileCac

chunkSplitter(),

context.options.rollup.wsam && wasmPlugin(context.options.rollup.wsam),
context.options.rollup.wasm && wasmPlugin(context.options.rollup.wasm),

context.options.declaration &&
context.options.rollup.isolatedDeclarations &&
Expand Down
2 changes: 1 addition & 1 deletion packages/packem/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ export interface RollupBuildOptions {
treeshake?: RollupOptions["treeshake"];
visualizer?: PluginVisualizerOptions | false;
watch?: RollupOptions["watch"];
wsam?: RollupWasmOptions | false;
wasm?: RollupWasmOptions | false;
}

export type Runtime = "react-server" | "react-native" | "edge-light" | "node";
Expand Down

0 comments on commit 273079e

Please sign in to comment.