Permalink
Browse files

Only serve items from out/dist on demand; use @import in CSS instead …

…of lots of includes; configure r.js to optimize CSS too
  • Loading branch information...
1 parent e760b14 commit 3e318e4a783894f70dd4d57312eacec4f91d6c48 @mattgodbolt committed Sep 30, 2016
Showing with 13 additions and 9 deletions.
  1. +2 −0 app.build.js
  2. +5 −4 app.js
  3. +6 −0 static/explorer.css
  4. +0 −5 static/index.html
View
@@ -8,6 +8,8 @@
removeCombined: true,
useStrict: true,
mainConfigFile: "static/main.js",
+ skipDirOptimize: true,
+ optimizeCss: "standard",
modules: [
{
name: "main"
View
@@ -46,7 +46,8 @@ var opts = nopt({
'language': [String],
'host': [String],
'port': [Number],
- 'propDebug': [Boolean]
+ 'propDebug': [Boolean],
+ 'static': [String]
});
// Set default values for ommited arguments
@@ -55,6 +56,7 @@ var language = opts.language || "C++";
var env = opts.env || ['dev'];
var hostname = opts.host || os.hostname();
var port = opts.port || 10240;
+var staticDir = opts.static || 'static';
var propHierarchy = ['defaults'].concat(env).concat([language, os.hostname()]);
console.log("properties hierarchy: " + propHierarchy);
@@ -419,9 +421,8 @@ findCompilers().then(function (compilers) {
webServer
.use(logger('combined'))
.use(compression())
- .use(sFavicon('static/favicon.ico'))
- .use(sStatic('out/dist', {maxAge: staticMaxAgeMs}))
- .use(sStatic('static', {maxAge: staticMaxAgeMs}))
+ .use(sFavicon(staticDir + '/favicon.ico'))
+ .use(sStatic(staticDir, {maxAge: staticMaxAgeMs}))
.use(bodyParser.json())
.use(restreamer())
.get('/client-options.json', clientOptionsHandler(compilers, fileSources))
View
@@ -1,3 +1,9 @@
+@import url("ext/bootstrap/dist/css/bootstrap.min.css");
+@import url("ext/codemirror/lib/codemirror.css");
+@import url("ext/golden-layout/src/css/goldenlayout-base.css");
+@import url("ext/golden-layout/src/css/goldenlayout-light-theme.css");
+@import url("ext/selectize/dist/css/selectize.bootstrap2.css");
+
.navbar {
border-radius: 0px;
margin-bottom: 5px;
View
@@ -5,11 +5,6 @@
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
- <link href="ext/bootstrap/dist/css/bootstrap.min.css" rel="stylesheet">
- <link href="ext/codemirror/lib/codemirror.css" rel="stylesheet">
- <link href="ext/golden-layout/src/css/goldenlayout-base.css" rel="stylesheet">
- <link href="ext/golden-layout/src/css/goldenlayout-light-theme.css" rel="stylesheet">
- <link href="ext/selectize/dist/css/selectize.bootstrap2.css" rel="stylesheet">
<link href="explorer.css" rel="stylesheet">
<script data-main="main" src="ext/requirejs/require.js"></script>
</head>

0 comments on commit 3e318e4

Please sign in to comment.