WinnetouJs Node Package
∯ Purpose
Serves a lot of methods to manipulate DOM and extends constructos super-powers.
∯ How to use
WinnetouJs node package can be imported from node modules folder if you use module type of script. If you use compiled WinnetouJs bundle, you can import it using module name.
Precompiled approach
You can save time using precompiled approach in WinnetouJs app development.
Modern browser have type module option when you add a script to your html. If
you use this approach you don't need to run
node wbr --bundleRelease
in order to see changes in your code.
Importing
You need to declare relative path with .js extension.
import { Winnetou } from "../node_modules/winnetoujs/src/winnetou.js";
Use
type="module"
when use it.
<script type="module"
src="./js/app.js"></script>
Transpiling constructos
Just use
node wbr
command and constructos will be transpiled automatically when constructos html
files was changed.
Compiled approach
Compiled approach will give you more compatibility with other npm packages and javascript ecosystem.
Importing
import { Winnetou } from "winnetoujs";
<script
src="./release/winnetouBundle.min.js"></script>
Transpiling constructos and compiling code
Use
node wbr --bundleRelease
in order to transpile and compile code to bundle. Watch behavior will run wbr
when source code changes.
Alias
You can use W
and Win
as Winnetou alias when importing it to your code.