Use imbapack and simplify

This commit is contained in:
somebee 2016-12-30 15:11:05 +01:00 committed by Sindre Aarsaether
parent d93ab1e484
commit 2e8e5c183a
9 changed files with 22 additions and 4089 deletions

2
.gitignore vendored
View File

@ -25,3 +25,5 @@ build/Release
# Dependency directory # Dependency directory
# https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git # https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git
node_modules node_modules
bundle.js

View File

@ -4,9 +4,10 @@ Tiny template for testing out Imba in the browser.
## Getting started ## Getting started
### Install Imba ### Install imba & webpack
```bash ```bash
npm install -g imba npm install -g imba
npm install -g webpack
``` ```
### Clone repository ### Clone repository
@ -19,14 +20,9 @@ git clone https://github.com/somebee/hello-world-imba.git
cd hello-world-imba cd hello-world-imba
``` ```
### Install dependencies ### Continously build project
```bash ```bash
npm install imbapack -w
```
### Watch to recompile
```bash
npm run watch
``` ```
## Run ## Run

File diff suppressed because one or more lines are too long

View File

@ -3,11 +3,9 @@
<head> <head>
<title>Hello World</title> <title>Hello World</title>
<meta charset="utf-8"> <meta charset="utf-8">
<!-- include the imba library -->
<script src="imba.dev.js"></script>
</head> </head>
<body> <body>
<!-- your script --> <!-- include your compiled bundle -->
<script src="lib/app.js"></script> <script src="bundle.js"></script>
</body> </body>
</html> </html>

8
index.imba Normal file
View File

@ -0,0 +1,8 @@
# require the imba stdlib
require 'imba'
# log to the console
console.log "hello world!"
# mount a single h1 tag in document body
Imba.mount <h1> "Hello world!"

View File

@ -1,7 +0,0 @@
(function(){
console.log("hello world");
return q$$('body').append(tag$.$h1().setText("Hello world").end());
})()

View File

@ -1,20 +1,13 @@
{ {
"name": "hello-world-imba", "name": "hello-world-imba",
"description": "Hello World for Imba", "description": "Hello World for Imba",
"keywords": [ "keywords": ["imba"],
"imba",
"website"
],
"author": "Sindre Aarsaether", "author": "Sindre Aarsaether",
"bugs": "https://github.com/somebee/hello-world-imba/issues", "bugs": "https://github.com/somebee/hello-world-imba/issues",
"version": "1.0.0", "version": "1.0.0",
"engines": { "engines": {
"node": ">=0.8.0" "node": ">=0.8.0"
}, },
"scripts": {
"build": "imba compile src/",
"watch": "imba watch src/"
},
"files": [], "files": [],
"directories": {}, "directories": {},
"homepage": "http://imba.io", "homepage": "http://imba.io",
@ -23,6 +16,6 @@
"url": "git://github.com/somebee/hello-world-imba.git" "url": "git://github.com/somebee/hello-world-imba.git"
}, },
"dependencies": { "dependencies": {
"imba": "^0.14.3" "imba": "^1.0.0"
} }
} }

View File

@ -1,4 +0,0 @@
console.log "hello world"
$$(body).append <h1> "Hello world"

4
webpack.config.js Normal file
View File

@ -0,0 +1,4 @@
module.exports = [{
entry: "./index.imba",
output: { filename: "./bundle.js" }
}]