mirror of
https://github.com/pyscript/pyscript.git
synced 2025-12-19 18:27:29 -05:00
* PyodideRuntime should be one of the runtimes * subsume interpreter into runtime API * fix eslint * add comments * move initializers, postInitializers, scriptsQueue, etc. to initialize() of Runtime Super Class * modify comment for initialize * small renaming * change id to default * fix pyscript.py import * try adding tests * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Add inlineDynamicImports option * Make jest happy about ESM modules * Attempt to make jest happy about pyodide * point to version in accordance with node module being used * fix base.ts * fix tests * fix indexURL path determination * edit pyodide.asm.js as a part of setup process * load runtime beforeAll tests * add test for loading a package * use only runPythonAsync underneath for pyodide * import PyodideInterface type directly from pyodide * add some comments Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Philipp Rudiger <prudiger@anaconda.com>
70 lines
1.7 KiB
JavaScript
70 lines
1.7 KiB
JavaScript
import svelte from "rollup-plugin-svelte";
|
|
import commonjs from "@rollup/plugin-commonjs";
|
|
import resolve from "@rollup/plugin-node-resolve";
|
|
import livereload from "rollup-plugin-livereload";
|
|
import { terser } from "rollup-plugin-terser";
|
|
import sveltePreprocess from "svelte-preprocess";
|
|
import typescript from "@rollup/plugin-typescript";
|
|
import css from "rollup-plugin-css-only";
|
|
import serve from "rollup-plugin-serve";
|
|
import { string } from "rollup-plugin-string";
|
|
|
|
const production = !process.env.ROLLUP_WATCH || (process.env.NODE_ENV === "production");
|
|
|
|
export default {
|
|
input: "src/main.ts",
|
|
output:[
|
|
{
|
|
sourcemap: true,
|
|
format: "iife",
|
|
inlineDynamicImports: true,
|
|
name: "app",
|
|
file: "build/pyscript.js",
|
|
},
|
|
{
|
|
file: "build/pyscript.min.js",
|
|
format: "iife",
|
|
sourcemap: true,
|
|
inlineDynamicImports: true,
|
|
plugins: [terser()],
|
|
},
|
|
],
|
|
plugins: [
|
|
svelte({
|
|
// add postcss config
|
|
preprocess: sveltePreprocess({
|
|
postcss: {
|
|
plugins: [require("autoprefixer")],
|
|
},
|
|
}),
|
|
compilerOptions: {
|
|
dev: !production,
|
|
},
|
|
}),
|
|
css({ output: "pyscript.css" }),
|
|
// Bundle all the Python files into the output file
|
|
string({
|
|
include: "./src/**/*.py",
|
|
}),
|
|
resolve({
|
|
browser: true,
|
|
dedupe: ["svelte"],
|
|
}),
|
|
commonjs(),
|
|
typescript({
|
|
sourceMap: !production,
|
|
inlineSources: !production,
|
|
}),
|
|
!production && serve(),
|
|
!production && livereload("public"),
|
|
// production && terser(),
|
|
!production && serve({
|
|
port: 8080,
|
|
contentBase: 'examples'}
|
|
)
|
|
],
|
|
watch: {
|
|
clearScreen: false,
|
|
},
|
|
};
|