Skip to content

Commit

Permalink
Added frontend assets
Browse files Browse the repository at this point in the history
  • Loading branch information
ElisDN committed Sep 20, 2018
1 parent d5f9156 commit 2b84e5c
Show file tree
Hide file tree
Showing 7 changed files with 7,589 additions and 11 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
/node_modules
/vendor
/phpunit.xml
/public/build
22 changes: 22 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"private": true,
"scripts": {
"dev": "npm run development",
"development": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js",
"watch": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --watch --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js",
"watch-poll": "npm run watch -- --watch-poll",
"hot": "cross-env NODE_ENV=development node_modules/webpack-dev-server/bin/webpack-dev-server.js --inline --hot --config=node_modules/laravel-mix/setup/webpack.config.js",
"prod": "npm run production",
"production": "cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --no-progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js"
},
"devDependencies": {
"axios": "^0.18",
"bootstrap": "^4.0.0",
"cross-env": "^5.1",
"font-awesome": "^4.7.0",
"jquery": "^3.2",
"laravel-mix": "^2.0",
"lodash": "^4.17.4",
"popper.js": "^1.12"
}
}
2 changes: 2 additions & 0 deletions resources/assets/js/app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
window.$ = window.jQuery = require('jquery');
require('bootstrap');
24 changes: 24 additions & 0 deletions resources/assets/sass/app.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
@import "~font-awesome/scss/font-awesome";
@import '~bootstrap/scss/bootstrap';

body {
padding-top: 70px;
}

h1 {
margin-top: 0
}

.app {
display: flex;
min-height: 100vh;
flex-direction: column;
}

.app-content {
flex: 1;
}

.app-footer {
padding-bottom: 1em;
}
13 changes: 2 additions & 11 deletions templates/layout/default.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,7 @@
<title>{% block title %}{% endblock %} - App</title>
<meta name="viewport" content="width=device-width, initial-scale=1" />
{% block meta %}{% endblock %}
<link href="https://use.fontawesome.com/releases/v5.0.6/css/all.css" rel="stylesheet" />
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" />
<style>
body { padding-top: 70px; }
h1 { margin-top: 0 }
.app { display: flex; min-height: 100vh; flex-direction: column; }
.app-content { flex: 1; }
.app-footer { padding-bottom: 1em; }
</style>
<link rel="stylesheet" href="/build/css/app.css" />
</head>
<body class="app">
<header class="app-header">
Expand Down Expand Up @@ -54,7 +46,6 @@
</div>
</footer>

<script src="https://code.jquery.com/jquery-3.3.1.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js"></script>
<script src="/build/js/app.js"></script>
</body>
</html>
7 changes: 7 additions & 0 deletions webpack.mix.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
let mix = require('laravel-mix');

mix
.setPublicPath('public/build')
.setResourceRoot('/build/')
.js('resources/assets/js/app.js', 'js')
.sass('resources/assets/sass/app.scss', 'css');
Loading

0 comments on commit 2b84e5c

Please sign in to comment.