Skip to content
Discussion options

You must be logged in to vote

@boshek one issue here is that OJS doesn't work well withself-contained: true, exactly because of javascript imports.

You'll find that the following works:

---
title: ojs import test
---


```{ojs}
import {myFunction} from "./myModule.js";

myFunction(3);
```

myModule.js:

export function myFunction(x)
{
    return x * x;
}

However, you will need to serve this page from a http or https server (instead of the local file:// scheme), because javascript module imports are only supported in the http and https protocols.

Replies: 1 comment 16 replies

Comment options

You must be logged in to vote
16 replies
@mcanouil

This comment was marked as off-topic.

@cscheid
Comment options

@mcanouil
Comment options

@cscheid
Comment options

Answer selected by cscheid
@cscheid
Comment options

@mcanouil
Comment options

@cscheid
Comment options

@mcanouil
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
ojs-engine Issues with the ojs engine
3 participants