Skip to content

Commit

Permalink
refactor build
Browse files Browse the repository at this point in the history
  • Loading branch information
ardean committed Feb 2, 2017
1 parent 699fedf commit 3297f8b
Show file tree
Hide file tree
Showing 13 changed files with 13 additions and 14 deletions.
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions dist/server/sauna-control.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,13 @@ class SaunaControl extends _events.EventEmitter {
this.sauna = options.sauna;
this.port = options.port || 80;
this.rootPath = options.rootPath || "/";
this.publicFolder = options.publicFolder || fixWindowsPath(_path2.default.join(__dirname, "../public"));
this.clientFolder = options.clientFolder || fixWindowsPath(_path2.default.join(__dirname, "../client"));

if (!this.sauna) throw new Error("no sauna!");

this.app = (0, _express2.default)();
this.app.disable("x-powered-by");
this.app.use(_express2.default.static(this.publicFolder));
this.app.use(_express2.default.static(this.clientFolder));
}

listen(port, fn) {
Expand Down
19 changes: 9 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "jssauna",
"version": "0.1.5",
"version": "0.1.6",
"description": "A Web Based Sauna Control System written in JavaScript",
"main": "src/index.js",
"author": "ardean",
Expand All @@ -21,15 +21,14 @@
],
"scripts": {
"start": "babel-node src/cli.js --username admin --pw 1234",
"export": "npm run build && npm run export-html && npm run export-css && npm run export-img",
"export-html": "cpy public/*.html dist/public",
"export-css": "cpy public/*.css dist/public",
"export-img": "cpy public/*.jpg dist/public",
"debug-export": "npm run export && babel-node dist/server/cli.js",
"build": "npm run cleanup && npm run bundle && npm run build-server",
"build": "npm run cleanup && npm run build-server && npm run build-client",
"build-server": "babel src --out-dir dist/server",
"cleanup": "del dist",
"bundle": "jspm build src/index.js dist/public/index.js --minify --skip-source-maps"
"build-client": "npm run build-js && npm run build-html && npm run build-css && npm run build-img",
"build-js": "jspm build src/index.js dist/client/index.js --minify --skip-source-maps",
"build-html": "cpy client/*.html dist/client",
"build-css": "cpy client/*.css dist/client",
"build-img": "cpy client/*.jpg dist/client",
"cleanup": "del-cli dist"
},
"bin": {
"jsSauna": "./bin/index.js"
Expand All @@ -52,7 +51,7 @@
},
"jspm": {
"directories": {
"baseURL": "public"
"baseURL": "client"
},
"dependencies": {
"events": "npm:jspm-nodelibs-events@^0.2.0",
Expand Down
4 changes: 2 additions & 2 deletions src/sauna-control.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ export default class SaunaControl extends EventEmitter {
this.sauna = options.sauna;
this.port = options.port ||  80;
this.rootPath = options.rootPath || "/";
this.publicFolder = options.publicFolder || fixWindowsPath(path.join(__dirname, "../public"));
this.clientFolder = options.clientFolder || fixWindowsPath(path.join(__dirname, "../client"));

if (!this.sauna) throw new Error("no sauna!");

this.app = express();
this.app.disable("x-powered-by");
this.app.use(express.static(this.publicFolder));
this.app.use(express.static(this.clientFolder));
}

listen(port, fn) {
Expand Down

0 comments on commit 3297f8b

Please sign in to comment.