Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade to inkjs 2.2.4 that enables mjs exports #1

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
"inkjs": "*"
},
"devDependencies": {
"inkjs": "2.2.2",
"inkjs": "2.2.4",
"@types/node": "20.9.4",
"typescript": "5.3.2",
"vite": "5.0.2"
Expand Down
7 changes: 2 additions & 5 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,9 @@ import path from "node:path";
import fs from "node:fs";
import EventEmitter from "node:events";

import inkjs from "inkjs";
import { Compiler, CompilerOptions } from "inkjs/full";
import type { PluginOption } from "vite";

const { Compiler, CompilerOptions } = inkjs;

class Tracker {
// Track dependencies of main ink files for hot reloading
// dependency file => main file
Expand Down Expand Up @@ -62,8 +60,7 @@ export function ink(): PluginOption {
}

function generateStoryModule(storyData: string) {
// Importing from inkjs/engine/Story breaks the production build so we import from a pre-bundled ink (engine only, no compiler)
return `import { Story } from "inkjs/dist/ink-es6";
return `import { Story } from "inkjs";
const story = new Story(${storyData});

let _callback;
Expand Down