From 34a2e033d62163df2c582e2f0741f8d8b631688e Mon Sep 17 00:00:00 2001 From: Anton Gunov Date: Wed, 11 Oct 2017 20:15:09 +0700 Subject: [PATCH] Fixed app routing --- assets/sass/layout/main.scss | 8 ++++++-- package.json | 3 ++- pages/app.pug | 9 ++++++++- public/app/index.html | 14 -------------- webpack.config.js | 6 +----- 5 files changed, 17 insertions(+), 23 deletions(-) delete mode 100644 public/app/index.html diff --git a/assets/sass/layout/main.scss b/assets/sass/layout/main.scss index 26d3e71..bdd502d 100644 --- a/assets/sass/layout/main.scss +++ b/assets/sass/layout/main.scss @@ -2,11 +2,15 @@ width: 100%; text-align: center; - &__title { - margin-bottom: 3rem; + &__app { + } &__button { } + + &__title { + margin-bottom: 3rem; + } } diff --git a/package.json b/package.json index 49599a9..7cd3144 100644 --- a/package.json +++ b/package.json @@ -9,11 +9,12 @@ }, "license": "MIT", "scripts": { + "app": "mkdir build/app && mv build/app.html build/app/index.html", "build": "npm run static && webpack --progress --hide-modules", "clean": "rm -rf build && mkdir build", "sass": "node-sass --include-path node_modules/ assets/sass/main.scss | postcss -o build/assets/css/main.css", "start": "npm run build && static build", - "static": "npm run clean && npm run public && npm run fonts && npm run pug && npm run sass", + "static": "npm run clean && npm run public && npm run fonts && npm run pug && npm run sass && npm run app", "dev": "npm run static && webpack-dev-server --inline --hot", "fonts": "mkdir -p build/assets/fonts/ && cp -r node_modules/font-awesome/fonts/* build/assets/fonts/", "public": "cp -r public/* build/", diff --git a/pages/app.pug b/pages/app.pug index f16918b..bb3c9b8 100644 --- a/pages/app.pug +++ b/pages/app.pug @@ -7,4 +7,11 @@ block head script(src="/assets/js/main.js" defer) block body - #app + .page + .page__wrapper + header.page__header.header + main.page__content.main + .main__app + #app + footer.page__footer.footer + +coded-with-love-by("Anton G.", "https://github.com/antongunov") diff --git a/public/app/index.html b/public/app/index.html deleted file mode 100644 index a794852..0000000 --- a/public/app/index.html +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - Learning Style Grid | App - - - - -
- - diff --git a/webpack.config.js b/webpack.config.js index 3848fbf..6d78bd2 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -43,10 +43,6 @@ module.exports = { }, devServer: { contentBase: resolve('build/'), - historyApiFallback: { - rewrites: [ - { from: /^\/app/, to: '/app.html' }, - ] - }, + historyApiFallback: true, }, };