mirror of
https://github.com/pyscript/pyscript.git
synced 2025-12-19 18:27:29 -05:00
fix autogenerated element (#397)
* use static string in checkId to simplify behaviour and ensure ids always start with alpha char * re-enable terser on minify * fix example local path
This commit is contained in:
@@ -18,7 +18,7 @@
|
|||||||
|
|
||||||
<body class="container">
|
<body class="container">
|
||||||
<!-- <py-repl id="my-repl" auto-generate="true"> </py-repl> -->
|
<!-- <py-repl id="my-repl" auto-generate="true"> </py-repl> -->
|
||||||
<py-script src="/todo.py"> </py-script>
|
<py-script src="./todo.py"> </py-script>
|
||||||
|
|
||||||
<main class="max-w-xs mx-auto mt-4">
|
<main class="max-w-xs mx-auto mt-4">
|
||||||
<section>
|
<section>
|
||||||
|
|||||||
@@ -84,7 +84,7 @@ export default {
|
|||||||
file: "examples/build/pyscript.min.js",
|
file: "examples/build/pyscript.min.js",
|
||||||
format: "iife",
|
format: "iife",
|
||||||
sourcemap: true,
|
sourcemap: true,
|
||||||
// plugins: [terser()],
|
plugins: [terser()],
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
plugins: [
|
plugins: [
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ export class BaseEvalElement extends HTMLElement {
|
|||||||
}
|
}
|
||||||
|
|
||||||
checkId() {
|
checkId() {
|
||||||
if (!this.id) this.id = this.constructor.name + '-' + guidGenerator();
|
if (!this.id) this.id = 'py-' + guidGenerator();
|
||||||
}
|
}
|
||||||
|
|
||||||
getSourceFromElement(): string {
|
getSourceFromElement(): string {
|
||||||
|
|||||||
Reference in New Issue
Block a user