Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Serve asynchronously compiled inline assets on error pages #56

Merged
merged 9 commits into from Oct 15, 2019
Merged
13 changes: 8 additions & 5 deletions layouts/partials/head.ejs
Expand Up @@ -8,10 +8,13 @@
<![endif]-->

<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.18.1/moment.js"></script>
<script src="/assets/scripts/main.js" charset="utf-8"></script>
<!-- styles -->
<link rel="shortcut icon" href="<%- template('branding.favicon') %>" type="image/x-icon" />
<link href="/assets/css/style.css" rel="stylesheet">
<% if (locals.inlineCSS) { %>
<style type="text/css"><%- inlineCSS %></style>
<% } else { %>
<link href="/assets/css/style.css" rel="stylesheet">
<script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.18.1/moment.js"></script>
<script src="/assets/scripts/main.js" charset="utf-8"></script>
<% } %>
<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet">
<link rel="shortcut icon" href="<%- template('branding.favicon') %>" type="image/x-icon" />
</head>
14 changes: 7 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion package.json
Expand Up @@ -20,6 +20,7 @@
"js-yaml": "^3.13.1",
"lodash": "^4.17.14",
"md5": "^2.2.1",
"mime-types": "^2.1.24",
"moment": "^2.24.0",
"node-sass": "^4.12.0",
"passport": "^0.4.0",
Expand Down Expand Up @@ -50,7 +51,9 @@
},
"scripts": {
"start": "node server/index.js",
"build": "node-sass --include-path custom/styles --include-path styles/partials --source-map public/css/style.css.map --source-map-contents styles/style.scss public/css/style.css",
"build:main": "node-sass --include-path custom/styles --include-path styles/partials --source-map public/css/style.css.map --source-map-contents styles/style.scss public/css/style.css",
"build:inline": "node-sass --include-path custom/styles --include-path styles/partials styles/errors.scss public/errors.css",
"build": "npm run build:main && npm run build:inline",
"debug": "node -r dotenv/config --inspect --debug-brk server/index.js",
"watch": "npm run build && concurrently \"nodemon --inspect=0.0.0.0 -r dotenv/config -e js,ejs server/index.js\" \"nodemon -e scss --watch styles --watch custom/styles -x npm run build\"",
"test": "NODE_ENV=test mocha test/**/*.test.js -r ./test/utils/bootstrap.js --recursive --exit",
Expand Down