Skip to content

Instantly share code, notes, and snippets.

@jamesmfriedman
Created April 25, 2017 20:58
Show Gist options
  • Save jamesmfriedman/91bf32f681ae4c63d493c82f1a418c1e to your computer and use it in GitHub Desktop.
Save jamesmfriedman/91bf32f681ae4c63d493c82f1a418c1e to your computer and use it in GitHub Desktop.
medium/webpack-inline-styles/index
<!DOCTYPE html>
<html>
<head>
<base href="/">
<title>James Friedman: UX / UI Design and Dev Consulting</title>
<!--EXPRESSION-->
<!--This is the magic inline ejs expression-->
<% if (~process.env.BUILD_ENV.search('optimized')) { %>
<style>
<%=require('!css-to-string-loader!css-loader!sass-loader!./styles/main.scss') %>
</style>
<% } %>
<!--/EXPRESSION-->
</head>
<body>
<app>
<div class="preloader">
loading...
</div>
</app>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment