From 080893310fb506f67372d6f8dce5b98a7bb2dd75 Mon Sep 17 00:00:00 2001 From: Andreas Dzialocha Date: Fri, 1 Dec 2017 17:22:37 +0100 Subject: [PATCH] Improve folder structure, remove unneded code --- .gitignore | 3 --- docs/assets/styles/base/global.scss | 2 +- docs/assets/styles/variables.scss | 2 ++ package.json | 13 +++++++------ server/httpServer.js | 3 +-- webpack.config.js | 4 +--- 6 files changed, 12 insertions(+), 15 deletions(-) diff --git a/.gitignore b/.gitignore index 292b4e5..0c4db4f 100644 --- a/.gitignore +++ b/.gitignore @@ -3,6 +3,3 @@ node_modules # build dist - -# docs -static diff --git a/docs/assets/styles/base/global.scss b/docs/assets/styles/base/global.scss index c09508b..81fc058 100644 --- a/docs/assets/styles/base/global.scss +++ b/docs/assets/styles/base/global.scss @@ -21,5 +21,5 @@ body { font-size: $font-size-regular; font-family: $font-family-regular; - line-height: 1.5; + line-height: $line-height-regular; } diff --git a/docs/assets/styles/variables.scss b/docs/assets/styles/variables.scss index 9200348..2860579 100644 --- a/docs/assets/styles/variables.scss +++ b/docs/assets/styles/variables.scss @@ -13,3 +13,5 @@ $font-weight-regular: 400; $font-weight-heavy: 700; $font-size-regular: 18px; + +$line-height-regular: 1.5; diff --git a/package.json b/package.json index 9602d2e..199df52 100644 --- a/package.json +++ b/package.json @@ -8,16 +8,17 @@ "npm": "~5.5.1" }, "scripts": { - "build": "npm run clean:dist && cross-env NODE_ENV=production webpack", - "clean": "npm run clean:dist && npm run clean:docs && npm run clean:node", - "clean:dist": "rimraf dist/", - "clean:docs": "rimraf static/", + "build": "npm run build:docs && npm run build:play", + "build:docs": "make-dir ./dist && static-generator build --source_dir ./docs --output_dir ./dist", + "build:play": "npm run clean:play && cross-env NODE_ENV=production webpack", + "clean": "npm run clean:dist && npm run clean:node", + "clean:dist": "rimraf dist", "clean:node": "rimraf node_modules/", - "docs": "make-dir ./static && static-generator build --source_dir ./docs --output_dir ./static", + "clean:play": "rimraf dist/play", "lint": "npm run lint:js && npm run lint:scss", "lint:js": "eslint automaton/scripts; exit 0", "lint:scss": "sass-lint -c .sass-lint.yml '{automaton,docs}/**/*.scss' -v -q", - "postinstall": "npm run build && npm run docs", + "postinstall": "npm run build", "serve": "webpack-dev-server --host 0.0.0.0", "start": "node server/index.js", "test": "echo \"Error: no test specified\" && exit 1" diff --git a/server/httpServer.js b/server/httpServer.js index 940db06..ab9fd8e 100644 --- a/server/httpServer.js +++ b/server/httpServer.js @@ -17,8 +17,7 @@ class HTTPServer { this.app = express() this.app.use(cors({ origin: '*' })) - this.app.use(express.static(path.join(__dirname, '..', 'static'))) - this.app.use('/play', express.static(path.join(__dirname, '..', 'dist'))) + this.app.use(express.static(path.join(__dirname, '..', 'dist'))) this.server = http.createServer(this.app) } diff --git a/webpack.config.js b/webpack.config.js index 47c533b..92b4476 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -6,8 +6,6 @@ const UglifyJsPlugin = require('uglifyjs-webpack-plugin') const path = require('path') const webpack = require('webpack') -const pkg = require('./package.json') - const SERVER_PORT = 9000 const DIST_FOLDER = 'dist' const SRC_FOLDER = 'automaton' @@ -77,7 +75,7 @@ module.exports = { [VENDOR_FOLDER_NAME]: APP_DEPENDENCIES, }, output: { - path: getPath(`./${DIST_FOLDER}`), + path: getPath(`./${DIST_FOLDER}/play`), filename: '[name].js', }, module: {