Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions app/views/head.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,6 @@
<link rel="icon" type="image/png" href="{{ asset('logo.png') }}"/>
<link rel="stylesheet" type="text/css" href="{{ asset('css/bulma.css') }}"/>

@if ((ThemeModule::ready()) && (ThemeModule::data()->include))
<link rel="stylesheet" type="text/css" href="{{ ThemeModule::data()->include }}"/>
@endif

@if (env('APP_DEBUG'))
<script src="{{ asset('js/vue.js') }}"></script>
@else
Expand All @@ -16,6 +12,12 @@

<script src="{{ asset('js/app.js', true) }}"></script>

<meta name="webpack-styles-end" content="marker"/>

@if ((ThemeModule::ready()) && (ThemeModule::data()->include))
<link rel="stylesheet" type="text/css" href="{{ ThemeModule::data()->include }}"/>
@endif

@if ((ThemeModule::ready()) && (ThemeModule::data()->script))
<script src="{{ ThemeModule::data()->script }}"></script>
@endif
Expand Down
62 changes: 38 additions & 24 deletions webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,24 +1,38 @@
const path = require('path');

module.exports = {
entry: './app/resources/js/app.js',
output: {
filename: 'app.js',
path: path.resolve(__dirname, 'public/js'),
},
module: {
rules: [
{
test: /\.s[ac]ss$/i,
use: [
// Creates `style` nodes from JS strings
'style-loader',
// Translates CSS into CommonJS
'css-loader',
// Compiles Sass to CSS
'sass-loader',
],
},
],
},
};
const path = require('path');

module.exports = {
entry: './app/resources/js/app.js',
output: {
filename: 'app.js',
path: path.resolve(__dirname, 'public/js'),
},
module: {
rules: [
{
test: /\.s[ac]ss$/i,
use: [
{
// Creates `style` nodes from JS strings
loader: 'style-loader',
options: {
// Insert styles BEFORE the marker, so theme CSS loads after and can override
insert: function(styleElement) {
const marker = document.querySelector('meta[name="webpack-styles-end"]');
if (marker) {
marker.parentNode.insertBefore(styleElement, marker);
} else {
// Fallback: insert at end of head
document.head.appendChild(styleElement);
}
},
},
},
// Translates CSS into CommonJS
'css-loader',
// Compiles Sass to CSS
'sass-loader',
],
},
],
},
};