Fix babel issues

This commit is contained in:
LordMathis 2018-12-28 14:42:58 +01:00
parent 741472f668
commit 7c3330a6df
11 changed files with 32 additions and 90 deletions

View File

@ -1,17 +1,10 @@
{ {
"presets":[ "presets":[
"es2015", "react" "es2015",
"react"
], ],
"env": { "plugins":[
"development": { "transform-object-rest-spread",
"presets": ["es2015", "react", "stage-0"], "transform-runtime"
"plugins": ["transform-runtime"], ]
"presets": ["react-hmre"]
}
},
"env": {
"build": {
"presets": ["es2015", "react", "stage-0"]
}
}
} }

Binary file not shown.

After

Width:  |  Height:  |  Size: 235 KiB

View File

@ -4,7 +4,6 @@
"name": "Matúš Námešný", "name": "Matúš Námešný",
"email": "matus@namesny.com", "email": "matus@namesny.com",
"social": { "social": {
"twitter": "https://twitter.com/matus_n",
"github": "https://github.com/LordMathis", "github": "https://github.com/LordMathis",
"codepen": "https://codepen.io/LordMathis/", "codepen": "https://codepen.io/LordMathis/",
"linkedin": "https://www.linkedin.com/in/mat%C3%BA%C5%A1-n%C3%A1me%C5%A1n%C3%BD-3903b6128/" "linkedin": "https://www.linkedin.com/in/mat%C3%BA%C5%A1-n%C3%A1me%C5%A1n%C3%BD-3903b6128/"

View File

@ -0,0 +1,10 @@
bodyhtml{height:100%}body{font-family:Open Sans,sans-serif;color:#2f2f2f;margin:0}h1,h2,h3,h4,h5,h6{font-family:Open Sans Condensed,sans-serif}
#Home__coverPage___3awuA{background:linear-gradient(140deg,rgba(10,108,245,.6) 20%,rgba(0,0,0,.9)),url(/245160ae8c20fbd72132e8f19ab5c90d.jpg) no-repeat 50% fixed;-webkit-background-size:cover;-moz-background-size:cover;background-size:cover;display:flex;flex-direction:column;justify-content:center;text-align:center;color:#fdfdfd;background-position:50%;background-repeat:no-repeat}#Home__coverPage___3awuA.Home__coverPageFull___1Ma8Y{height:100vh;width:100%}#Home__coverPageName___Ono33{font-size:5em}#Home__coverPageName___Ono33 a,#Home__coverPageName___Ono33 a:hover{color:#fdfdfd;text-decoration:none}.Home__social___31MFC{text-align:center}.Home__social___31MFC a{color:#fdfdfd;display:inline-block;margin:10px}.Home__menuLinks___3J0vz ul{list-style:none;margin-left:0;padding:10px}.Home__menuLinks___3J0vz ul li{margin:5px}.Home__menuLinks___3J0vz ul li a{color:#fdfdfd;text-decoration:none;font-size:1.4em}
.Blog__postDate___2syXo{margin-right:50px}.Blog__postTitle___5dx5x{color:#144a98;text-decoration:none;text-transform:capitalize;font-family:Open Sans Condensed,sans-serif;font-size:1.2em}.Blog__postsWrapper___15Pu7{margin-top:20px}.Blog__postListItem___3babS{margin:8px}.Blog__postListItem___3babS td{vertical-align:top}
.content__contentWrapper___3JR0e{display:inline-block;overflow:auto;box-sizing:border-box;padding:20px;width:100%}.content__contentWrapper___3JR0e a{color:#144a98}@media (min-width:992px){.content__contentWrapper___3JR0e{width:960px}}.content__content___2hWvT{box-sizing:border-box;text-align:left}
.Post__postContent___2qxpB{clear:both}.Post__postContent___2qxpB h1,.Post__postContent___2qxpB h2,.Post__postContent___2qxpB h4,.Post__postContent___2qxpB h5,.Post__postContent___2qxpB h6{color:#2f2f2f}.Post__postDate___mOa_I{float:right}.Post__postDate___mOa_I h3{font-weight:400}
.Wrapper__centerContent___3I7iS{text-align:center}
.Spinner__spinnerWrapper___1rE4f{width:100%;display:flex;justify-content:center}.Spinner__ldsEllipsis___MQ__N{display:inline-block;position:relative;width:64px;height:64px;margin:0 auto}.Spinner__ldsEllipsis___MQ__N div{position:absolute;top:27px;width:11px;height:11px;border-radius:50%;background:#2f2f2f;animation-timing-function:cubic-bezier(0,1,1,0)}.Spinner__ldsEllipsis___MQ__N div:first-child{left:6px;animation:Spinner__lds-ellipsis1___kmvdD .6s infinite}.Spinner__ldsEllipsis___MQ__N div:nth-child(2){left:6px;animation:Spinner__lds-ellipsis2___1KPxc .6s infinite}.Spinner__ldsEllipsis___MQ__N div:nth-child(3){left:26px;animation:Spinner__lds-ellipsis2___1KPxc .6s infinite}.Spinner__ldsEllipsis___MQ__N div:nth-child(4){left:45px;animation:Spinner__lds-ellipsis3___25QMr .6s infinite}@keyframes Spinner__lds-ellipsis1___kmvdD{0%{transform:scale(0)}to{transform:scale(1)}}@keyframes Spinner__lds-ellipsis3___25QMr{0%{transform:scale(1)}to{transform:scale(0)}}@keyframes Spinner__lds-ellipsis2___1KPxc{0%{transform:translate(0)}to{transform:translate(19px)}}
.Header__mainHeader___2VDf9{border-left:5px solid #144a98;padding:5px;margin:0;text-align:left}.Header__mainHeader___2VDf9 h1{margin:0}
.Navbar__navbar___2l-xR{background:linear-gradient(140deg,rgba(10,108,245,.6) 20%,rgba(0,0,0,.9)),url(/245160ae8c20fbd72132e8f19ab5c90d.jpg) no-repeat 50% fixed;color:#fdfdfd;background-position:50%;background-repeat:no-repeat;text-align:left;overflow:auto}h2{color:#fdfdfd;padding-left:5px}.Navbar__social___5OYU1{display:inline-block;float:right;vertical-align:bottom}.Navbar__social___5OYU1 a{color:#fdfdfd;display:inline-block;margin:10px}.Navbar__links___2YPE8{display:inline-block;float:left}.Navbar__links___2YPE8 ul{list-style:none}.Navbar__links___2YPE8 ul li{font-family:Open Sans Condensed,sans-serif;display:inline;margin:5px}.Navbar__links___2YPE8 ul li a{color:#fdfdfd;text-decoration:none}.Navbar__nameLink___2o3NS{font-size:1.4em}

View File

@ -5,8 +5,7 @@
"main": "index.js", "main": "index.js",
"scripts": { "scripts": {
"build": "NODE_ENV=production webpack -p --progress", "build": "NODE_ENV=production webpack -p --progress",
"start": "NODE_ENV=production node ./src/server.js", "start": "NODE_ENV=production node ./server.js"
"dev": "NODE_ENV=development babel-node ./src/server.js --presets es2015,stage-2 ./srcserver.js"
}, },
"keywords": [ "keywords": [
"porfolio", "porfolio",
@ -33,12 +32,13 @@
"babel-core": "^6.7.6", "babel-core": "^6.7.6",
"babel-jest": "*", "babel-jest": "*",
"babel-loader": "^7.1.4", "babel-loader": "^7.1.4",
"babel-plugin-transform-object-rest-spread": "^6.26.0",
"babel-plugin-transform-runtime": "^6.7.5", "babel-plugin-transform-runtime": "^6.7.5",
"babel-polyfill": "^6.26.0", "babel-polyfill": "^6.26.0",
"babel-preset-es2015": "^6.6.0", "babel-preset-es2015": "^6.6.0",
"babel-preset-react": "^6.5.0", "babel-preset-react": "^6.5.0",
"babel-preset-react-hmre": "^1.1.1", "babel-preset-react-hmre": "^1.1.1",
"babel-preset-stage-0": "^6.5.0", "babel-preset-stage-0": "^6.24.1",
"babel-register": "^6.7.2", "babel-register": "^6.7.2",
"babel-runtime": "^6.26.0", "babel-runtime": "^6.26.0",
"clean-webpack-plugin": "^0.1.19", "clean-webpack-plugin": "^0.1.19",

1
server.js Normal file

File diff suppressed because one or more lines are too long

View File

@ -20,33 +20,8 @@ var filename = './src/utils/data.json';
var dataStub = {"posts": [], "other": []}; var dataStub = {"posts": [], "other": []};
fs.writeFileSync(filename, JSON.stringify(dataStub)); fs.writeFileSync(filename, JSON.stringify(dataStub));
// // initalize webpack dev middleware if in development context
// if (process.env.NODE_ENV === 'development') {
// var webpack = require('webpack')
// var config = require('../webpack.config')
//
// var devMiddleware = require('webpack-dev-middleware')
// var hotDevMiddleware = require('webpack-hot-middleware')
// var compiler = webpack(config)
// var devMiddlewareConfig = {
// noInfo: true,
// stats: {colors: true},
// publicPath: config.output.publicPath
// }
//
// app.use(devMiddleware(compiler, devMiddlewareConfig))
// app.use(hotDevMiddleware(compiler))
// }
require('./utils/scanner')(); require('./utils/scanner')();
var api = require('./utils/api');
app.use("/api", api);
var staticFiles = require('./utils/staticFiles');
app.use("/static", staticFiles);
var serverRender = require('./utils/serverRender'); var serverRender = require('./utils/serverRender');
app.get("*", serverRender); app.get("*", serverRender);

View File

@ -3,7 +3,6 @@ import React from 'react'
import { renderToString } from 'react-dom/server' import { renderToString } from 'react-dom/server'
import { StaticRouter as Router } from 'react-router-dom' import { StaticRouter as Router } from 'react-router-dom'
import { App } from '../components/App' import { App } from '../components/App'
import manifest from '../../public/static/manifest.json'
import routes from './routes' import routes from './routes'
function serverRender(req, res) { function serverRender(req, res) {
@ -47,11 +46,11 @@ function renderFullPage(html, manifest) {
<!-- Font Awesome --> <!-- Font Awesome -->
<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.6.3/css/font-awesome.min.css" rel="stylesheet" rel="preload" integrity="sha384-T8Gy5hrqNKT+hzMclPo118YTQO6cYprQmhrYwIiQ/3axmI1hQomh7Ud2hPOy8SP1" crossorigin="anonymous"> <link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.6.3/css/font-awesome.min.css" rel="stylesheet" rel="preload" integrity="sha384-T8Gy5hrqNKT+hzMclPo118YTQO6cYprQmhrYwIiQ/3axmI1hQomh7Ud2hPOy8SP1" crossorigin="anonymous">
<!-- Stylesheet --> <!-- Stylesheet -->
${process.env.NODE_ENV === 'production' ? `<link href=${manifest['bundle.css']} rel="stylesheet">` : ''} <link href="bundle.css" rel="stylesheet">
</head> </head>
<body> <body>
<div id="root">${process.env.NODE_ENV === 'production' ? html : `<div>${html}</div>`}</div> <div id="root">${process.env.NODE_ENV === 'production' ? html : `<div>${html}</div>`}</div>
<script src="${manifest['bundle.js']}" async></script> <script src="bundle.js" async></script>
</body> </body>
</html> </html>
` `

View File

@ -1,40 +0,0 @@
const staticFiles = require('express').Router();
const path = require('path');
import manifest from '../../public/static/manifest.json'
staticFiles.get('/*.js', (req, res) => {
const filename = req.url.split("/").pop();
if (req.acceptsEncodings('gzip')) {
res.set({
'Content-Encoding': 'gzip',
'Content-Type': 'text/javascript',
'Cache-Control': 'max-age=31536000'
});
res.sendFile(path.join(process.cwd(), '/public/', manifest[`${filename}.gz`]));
} else {
res.set('Cache-Control', 'max-age=31536000');
res.sendFile(path.join(process.cwd(), '/public/', manifest['bundle.js']));
}
});
staticFiles.get('/*.css', (req, res) => {
const filename = req.url.split("/").pop();
if (req.acceptsEncodings('gzip')) {
res.set({
'Content-Encoding': 'gzip',
'Content-Type': 'text/css',
'Cache-Control': 'max-age=31536000'
});
res.sendFile(path.join(process.cwd(), '/public/', manifest[`${filename}.gz`]));
} else {
res.set('Cache-Control', 'max-age=31536000');
res.sendFile(path.join(process.cwd(), '/public/', manifest['bundle.css']));
}
});
staticFiles.get('*.jpg', (req, res) => {
res.set('Cache-Control', 'max-age=31536000');
res.sendFile(path.join(process.cwd(), '/public/static', req.url))
});
module.exports = staticFiles;

View File

@ -74,10 +74,10 @@ const browserConfig = {
}, },
plugins: [ plugins: [
new webpack.DefinePlugin({__isBrowser__: "true"}), new webpack.DefinePlugin({__isBrowser__: "true"}),
new CleanWebpackPlugin(['dist', 'public/static'], {}), new CleanWebpackPlugin(['public/static'], {}),
new MiniCssExtractPlugin({filename: '[name].[contenthash].css'}), new MiniCssExtractPlugin({filename: '[name].[contenthash].css'}),
new CompressionPlugin({}), // new CompressionPlugin({}),
new ManifestPlugin(), // new ManifestPlugin(),
] ]
} }

View File

@ -545,6 +545,7 @@ babel-plugin-syntax-decorators@^6.13.0:
babel-plugin-syntax-do-expressions@^6.8.0: babel-plugin-syntax-do-expressions@^6.8.0:
version "6.13.0" version "6.13.0"
resolved "https://registry.yarnpkg.com/babel-plugin-syntax-do-expressions/-/babel-plugin-syntax-do-expressions-6.13.0.tgz#5747756139aa26d390d09410b03744ba07e4796d" resolved "https://registry.yarnpkg.com/babel-plugin-syntax-do-expressions/-/babel-plugin-syntax-do-expressions-6.13.0.tgz#5747756139aa26d390d09410b03744ba07e4796d"
integrity sha1-V0d1YTmqJtOQ0JQQsDdEugfkeW0=
babel-plugin-syntax-dynamic-import@^6.18.0: babel-plugin-syntax-dynamic-import@^6.18.0:
version "6.18.0" version "6.18.0"
@ -565,6 +566,7 @@ babel-plugin-syntax-flow@^6.18.0:
babel-plugin-syntax-function-bind@^6.8.0: babel-plugin-syntax-function-bind@^6.8.0:
version "6.13.0" version "6.13.0"
resolved "https://registry.yarnpkg.com/babel-plugin-syntax-function-bind/-/babel-plugin-syntax-function-bind-6.13.0.tgz#48c495f177bdf31a981e732f55adc0bdd2601f46" resolved "https://registry.yarnpkg.com/babel-plugin-syntax-function-bind/-/babel-plugin-syntax-function-bind-6.13.0.tgz#48c495f177bdf31a981e732f55adc0bdd2601f46"
integrity sha1-SMSV8Xe98xqYHnMvVa3AvdJgH0Y=
babel-plugin-syntax-jsx@^6.3.13, babel-plugin-syntax-jsx@^6.8.0: babel-plugin-syntax-jsx@^6.3.13, babel-plugin-syntax-jsx@^6.8.0:
version "6.18.0" version "6.18.0"
@ -624,6 +626,7 @@ babel-plugin-transform-decorators@^6.24.1:
babel-plugin-transform-do-expressions@^6.22.0: babel-plugin-transform-do-expressions@^6.22.0:
version "6.22.0" version "6.22.0"
resolved "https://registry.yarnpkg.com/babel-plugin-transform-do-expressions/-/babel-plugin-transform-do-expressions-6.22.0.tgz#28ccaf92812d949c2cd1281f690c8fdc468ae9bb" resolved "https://registry.yarnpkg.com/babel-plugin-transform-do-expressions/-/babel-plugin-transform-do-expressions-6.22.0.tgz#28ccaf92812d949c2cd1281f690c8fdc468ae9bb"
integrity sha1-KMyvkoEtlJws0SgfaQyP3EaK6bs=
dependencies: dependencies:
babel-plugin-syntax-do-expressions "^6.8.0" babel-plugin-syntax-do-expressions "^6.8.0"
babel-runtime "^6.22.0" babel-runtime "^6.22.0"
@ -821,11 +824,12 @@ babel-plugin-transform-flow-strip-types@^6.22.0, babel-plugin-transform-flow-str
babel-plugin-transform-function-bind@^6.22.0: babel-plugin-transform-function-bind@^6.22.0:
version "6.22.0" version "6.22.0"
resolved "https://registry.yarnpkg.com/babel-plugin-transform-function-bind/-/babel-plugin-transform-function-bind-6.22.0.tgz#c6fb8e96ac296a310b8cf8ea401462407ddf6a97" resolved "https://registry.yarnpkg.com/babel-plugin-transform-function-bind/-/babel-plugin-transform-function-bind-6.22.0.tgz#c6fb8e96ac296a310b8cf8ea401462407ddf6a97"
integrity sha1-xvuOlqwpajELjPjqQBRiQH3fapc=
dependencies: dependencies:
babel-plugin-syntax-function-bind "^6.8.0" babel-plugin-syntax-function-bind "^6.8.0"
babel-runtime "^6.22.0" babel-runtime "^6.22.0"
babel-plugin-transform-object-rest-spread@^6.22.0: babel-plugin-transform-object-rest-spread@^6.22.0, babel-plugin-transform-object-rest-spread@^6.26.0:
version "6.26.0" version "6.26.0"
resolved "https://registry.yarnpkg.com/babel-plugin-transform-object-rest-spread/-/babel-plugin-transform-object-rest-spread-6.26.0.tgz#0f36692d50fef6b7e2d4b3ac1478137a963b7b06" resolved "https://registry.yarnpkg.com/babel-plugin-transform-object-rest-spread/-/babel-plugin-transform-object-rest-spread-6.26.0.tgz#0f36692d50fef6b7e2d4b3ac1478137a963b7b06"
dependencies: dependencies:
@ -949,9 +953,10 @@ babel-preset-react@^6.5.0:
babel-plugin-transform-react-jsx-source "^6.22.0" babel-plugin-transform-react-jsx-source "^6.22.0"
babel-preset-flow "^6.23.0" babel-preset-flow "^6.23.0"
babel-preset-stage-0@^6.5.0: babel-preset-stage-0@^6.24.1:
version "6.24.1" version "6.24.1"
resolved "https://registry.yarnpkg.com/babel-preset-stage-0/-/babel-preset-stage-0-6.24.1.tgz#5642d15042f91384d7e5af8bc88b1db95b039e6a" resolved "https://registry.yarnpkg.com/babel-preset-stage-0/-/babel-preset-stage-0-6.24.1.tgz#5642d15042f91384d7e5af8bc88b1db95b039e6a"
integrity sha1-VkLRUEL5E4TX5a+LyIsduVsDnmo=
dependencies: dependencies:
babel-plugin-transform-do-expressions "^6.22.0" babel-plugin-transform-do-expressions "^6.22.0"
babel-plugin-transform-function-bind "^6.22.0" babel-plugin-transform-function-bind "^6.22.0"