forked from argoproject/Argo
-
-
Notifications
You must be signed in to change notification settings - Fork 83
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
Source maps #646
Merged
Merged
Source maps #646
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This adds inline sourcemaps to the unminified CSS output from the less compiler. This can add up to 250kb per file. If you want to commit the production code, try grunt less:production.
…ss, and adding a js file to minification
Conflicts: functions.php Not sure how well this merge went, the code looks correct though.
Change 2015-04-09: added "Why" section to PR description. |
This is awesome. I consider this a huge step forward for Largo. Thanks for the effort. Couple things:
Going to merge this and create new issues based on feedback above. |
rnagle
added a commit
that referenced
this pull request
Apr 14, 2015
Source maps, LARGO_DEBUG switch for determining when to use minified assets.
This was referenced Apr 14, 2015
This was referenced Apr 14, 2015
Closed
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Changes:
LARGO_DEBUG
constant that controls whether or not minified assets are used in:grunt watch
grunt watch
taskjs/widgets-php.js
to thegrunt uglify
taskWhy?
Minified assets: Faster to download for the user.
Sourcemaps: When you go to the web inspector to see why the CSS is messed up, instead of saying
style.css
on line 3040, it tells you that the rule is inheader.less
on line 34.Inline sourcemaps: This is a workaround. grunt-contrib-less doesn't do multiple sourcemap file output when you compile multiple LESS files concurrently. More about that here. This PR puts the sourcemaps in the unminified CSS files, linking to the LESS files in the theme.
Inline sourcemaps not in minified CSS: The sourcemap for Largo's main style.css is near 250,000 characters. Putting that in the minified, faster-to-download asset doesn't seem right.
Changes to Gruntfile:
- sourcemaps require the URI path, not the filesystem path, so
var path
is created to hold the path of the file relative to the Wordpress root.-
cssmin
is added togrunt watch
to make sure that the minified assets are updatedQuestions:
less:production
task be removed from thegrunt less
task, since the production css assets are created bycssmin
?js/jquery.idTabs.js
: only included on single pages, should probably be enqueued from the widget that uses it instead of on all single pages. Adding this to theuglify
task results in an output file namedjquery.min.js
instead ofjquery.idTabs.min.js
because grunt reads extensions from the first period. That is a wontfix behavior. If we were to minify this, we should consider renaming it tojquery-idTabs.js
homepages/assets/js/single.js
: used on the homepagejs/tinymce/pluins/largo/editor_plugin.js
andtinymce.js
: only used in the adminjs/select2
: the locale filesinc/wp-taxonomy-landing/series.js
andseries.css
: only used in the admin, enqueued ininc/wp-taxonomy-landing/functions/cftl-admin.php
For #432 and #369