1
0
mirror of https://github.com/pyscript/pyscript.git synced 2022-05-01 19:47:48 +03:00

add rollup-plugin-serve plugin to serve from examples folder when in dev

This commit is contained in:
Fabio Pliger
2022-04-11 20:11:40 -05:00
parent 6f2f6ac624
commit 9becc5381f
3 changed files with 30 additions and 2 deletions

View File

@@ -6,10 +6,11 @@ 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'
const production = !process.env.ROLLUP_WATCH;
function serve() {
function serve_() {
let server;
function toExit() {
@@ -40,7 +41,7 @@ export default {
sourcemap: true,
format: "iife",
name: "app",
file: "build/pyscript.js",
file: "examples/build/pyscript.js",
},
plugins: [
svelte({
@@ -67,6 +68,10 @@ export default {
!production && serve(),
!production && livereload("public"),
production && terser(),
serve({
port: 8080,
contentBase: 'examples'}
)
],
watch: {
clearScreen: false,