Commit 7f9e188759b790087ad7ee3b6c49554a603e8fad
build with browelectrify instead of standard browserify
Dominic Tarr committed on 8/4/2016, 1:58:38 AMParent: 9abd057463439027a5ac4f40d5f7e5f0316deb6c
Files changed
build.js | changed |
index.js | changed |
package.json | changed |
build.js | ||
---|---|---|
@@ -1,9 +1,17 @@ | ||
1 … | +var fs = require('fs') | |
2 … | +var path = require('path') | |
1 | 3 … | |
2 | -console.log( | |
4 … | +fs.writeFileSync( | |
5 … | + path.join(__dirname, 'style.css.json'), | |
6 … | + JSON.stringify(fs.readFileSync(path.join(__dirname, 'style.css'), 'utf8')) | |
7 … | +) | |
8 … | + | |
9 … | + | |
10 … | +fs.writeFileSync(path.join(__dirname, 'modules', '_index.js'), | |
3 | 11 … | 'module.exports = {\n' |
4 | 12 … | + |
5 | - require('fs').readdirSync(require('path').join(__dirname, 'modules')) | |
13 … | + fs.readdirSync(path.join(__dirname, 'modules')) | |
6 | 14 … | .filter(function (file) { |
7 | 15 … | return file !== '_index.js' && /\.js$/.test(file) |
8 | 16 … | }) |
9 | 17 … | .map(function (file) { |
@@ -11,5 +19,4 @@ | ||
11 | 19 … | }).join(',\n') |
12 | 20 … | + |
13 | 21 … | '\n}' |
14 | 22 … | ) |
15 | - |
index.js | ||
---|---|---|
@@ -25,10 +25,9 @@ | ||
25 | 25 … | console.log(require('depject/graph')(modules)) |
26 | 26 … | process.exit(0) |
27 | 27 … | } |
28 | 28 … | |
29 | -document.head.appendChild( | |
30 | - h('style', fs.readFileSync('./style.css', 'utf8') | |
31 | -)) | |
29 … | +document.head.appendChild(h('style', require('./style.css.json'))) | |
32 | 30 … | |
33 | 31 … | document.body.appendChild(modules['app.js'].app()) |
34 | 32 … | |
33 … | + |
package.json | |||
---|---|---|---|
@@ -38,22 +38,22 @@ | |||
38 | 38 … | "ssb-keys": "^6.0.0", | |
39 | 39 … | "ssb-markdown": "^3.0.0", | |
40 | 40 … | "ssb-mentions": "^0.1.0", | |
41 | 41 … | "ssb-sort": "0.0.0", | |
42 | - "suggest-box": "^2.0.0", | ||
42 … | + "suggest-box": "^2.2.1", | ||
43 | 43 … | "text-node-searcher": "^1.1.0" | |
44 | 44 … | }, | |
45 | 45 … | "devDependencies": { | |
46 | - "brfs": "^1.4.3", | ||
47 | - "indexhtmlify": "^1.2.1" | ||
46 … | + "browselectrify": "^1.0.1" | ||
48 | 47 … | }, | |
49 | 48 … | "browser": { | |
50 | 49 … | "./modules/index.js": "./modules/_index.js" | |
51 | 50 … | }, | |
52 | 51 … | "scripts": { | |
53 | - "build": "node build.js > modules/_index.js && mkdir -p build && browserify -t brfs index.js > build/bundle.js && indexhtmlify < build/bundle.js > build/index.html", | ||
52 … | + "build": "node build.js > modules/_index.js && mkdir -p build && browselectrify index.js > build/bundle.js", | ||
54 | 53 … | "graph": "node index.js | dot -Tsvg > graph.svg", | |
55 | 54 … | "test": "set -e; for t in test/*.js; do node $t; done" | |
56 | 55 … | }, | |
57 | 56 … | "author": "Dominic Tarr <dominic.tarr@gmail.com> (http://dominictarr.com)", | |
58 | 57 … | "license": "MIT" | |
59 | 58 … | } | |
59 … | + |
Built with git-ssb-web