- Download and install npm(node)
-
install miojs, a command-line tool to help with the projects built with MIOJSLibs.
npm install miojs -g
-
run
init
, with the desired project name.miojs init my-new-project-name
It will create a basic frame for the project, into a new folder that is named as the given project name.
-
Congratulations, now you have a template project that uses MIOJSLibs.
-
Navigate to the project folder.
-
Install the dependencies (including miojslibs).
npm install
-
Install && copy the miojslibs to
app/libs/miojslibs
npm run update-libs # since it uses cp currently it only works in mac||linux
-
Build the scss files of the project
npm run scss:watch
-
Bundle the typescript files of the project.
npm run tsc
-
Serve the files with a basic
http-server
.npm start
-
Navigate to http://localhost:9090 in an ES5 compatible browser.
-
Initialize your project with npm (if you haven't already).
cd my-project-directory npm init
This will create a
package.json
file into the project root directory. -
Install
miojslibs
(this project) from npm.npm install miojslibs --save
-
If you use typescript add miojslibs to types into
tsconfig.json
.{ "compilerOptions": { "types": [ "miojslibs" ] } }
-
Copy/move/reference the
node_modules/miojslibs/dist/js
folder to your publicly served files underlibs/miojslibs
.This project uses webworkers, currently they are loaded from
libs/miojslibs/webworkers
, they need to be placed in that folder due to the fact that webworkers' scriptURL argument is relative to the entry script's base URL. -
Add the script to your
index.html
before any other MIOJSLibs related scripts.<script src="libs/miojslibs/miojslibs.js"></script>
-
Use the framework.