Skip to content

The-Sir-Community/BF6-Portal-Template

Repository files navigation

Battlefield 6 Portal Mod Template

Provides an expanded and easier to use starting template for Battlefield 6 Portal Modding. This builds off of the examples provided in the PortalSDK, and provides a project that includes type hints, import/export functionality, and a compilation step.

Typescript Features and Limitations (WIP)

  • Supports relative imports only (./ and ../).

  • Preserves live bindings for all exports.

  • Supports circular dependencies.

  • Handles the following import styles:

    • Default imports: import Default from "./mod";
    • Named imports: import { A, B as C } from "./mod";
    • Namespace imports: import * as ns from "./mod";
    • Side-effect imports: import "./mod";
  • Handles the following export patterns:

    • export const/let/var
    • export function/class
    • export default
    • export { a, b as c }
    • export * from "./mod"
  • Outputs a single .ts bundle that can be uploaded to Battlefield 6 Portal.


Usage

  1. Copy this template

  2. Install dependencies:

npm install
  1. Bundle the typescript
npm run bundle

The output will be in dist/output.ts

  1. Upload to your Portal Experience

About

A starter template for Battlefield 6 Portal modding, including tools to provide more natural typescript experience. This includes full type checking with the API, real imports, plus export and minify functions.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published