-
-
Notifications
You must be signed in to change notification settings - Fork 10.4k
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
Compile assets with grunt #730
Conversation
Not sure what you think, but I much prefer this approach? |
Updated with version from package, set a maxAge of one year and added the compress middle ware for gzipping. Also, moved the helper to the core helpers module and rebased on master. |
Hold off on this, something is broken and the server is not loading. Trying to figure it out now. EDIT: Found it, was a typo on server.use. |
Updated again with @javorszky validation script included and had to add a semi-colon to the end of shortcuts.js because it was breaking when concatenated. |
Does the helper work from the core helpers file? It's used server side for the themes. |
Yeah, looks like it does from my testing. Felt like it was a little out of place in the middle of that initTheme method. |
Something in this PR is failing on node 11 :( |
This is kinda strange: https://magnum.travis-ci.com/TryGhost/Ghost/builds/1217429 commit 0663308 worked |
- Made a helper called ghostScriptTags that will spit out the relevant script tags with version parameter; 4 unminified files in development, 1 minified file in production. - Added grunt concat and uglify tasks to build files into core/built - Fixed some unit tests by making them native date objects
Updated by taking out the express.compress() middleware. It looks like something is broken with it on 11.3. All the assets were being served with garbled contents. |
This is neat, absolutely what I was looking for 👍 |
script tags with version parameter; 4 unminified files in development,
1 minified file in production.
Some off the cuff metrics on this that I could measure with the chrome dev tools
The request size has also gone down but I'm not sure how to measure that fairly because of all the 304's and what-not after the first time you load the page.
I tested out the build task by running
grunt build
and then going to.build/build/
and runningnode index.js
andNODE_ENV=production node index.js
. Tell me what you think and let me know if you want anything changed in it.