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
# https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git
node_modules
bundle.js

View File

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

File diff suppressed because one or more lines are too long

View File

@ -3,11 +3,9 @@
<head>
<title>Hello World</title>
<meta charset="utf-8">
<!-- include the imba library -->
<script src="imba.dev.js"></script>
</head>
<body>
<!-- your script -->
<script src="lib/app.js"></script>
<!-- include your compiled bundle -->
<script src="bundle.js"></script>
</body>
</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",
"description": "Hello World for Imba",
"keywords": [
"imba",
"website"
],
"keywords": ["imba"],
"author": "Sindre Aarsaether",
"bugs": "https://github.com/somebee/hello-world-imba/issues",
"version": "1.0.0",
"engines": {
"node": ">=0.8.0"
},
"scripts": {
"build": "imba compile src/",
"watch": "imba watch src/"
},
"files": [],
"directories": {},
"homepage": "http://imba.io",
@ -23,6 +16,6 @@
"url": "git://github.com/somebee/hello-world-imba.git"
},
"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" }
}]