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

Magento2 JS minification #1138

Closed
csdougliss opened this issue Mar 27, 2015 · 9 comments
Closed

Magento2 JS minification #1138

csdougliss opened this issue Mar 27, 2015 · 9 comments

Comments

@csdougliss
Copy link
Contributor

Enabled JS Minification in the admin (along with bundling.. whatever that is), along with merging.

However when I look in firebug net I see a merged JavaScipt file but also about another 20 files, such as translate.js etc.

@buskamuza
Copy link
Contributor

Hi, @craigcarnell.
Merging is applicable only for assets included via layouts. If the asset is included directly on a page or using RequireJS technique, it will not be merged. So it may happen that some of the files that you see loaded separately are included in that way.

@vkorotun
Copy link
Contributor

Hi, @craigcarnell.
While "Merge JavaScript Files" option deal with files declared via layouts, as @buskamuza has mentioned, the second option "Enable Javascript Bundling" deals with JavaScript files which are not included via layouts but loaded using RequireJS.
There are two preconditions for using this option properly:

  1. You need to run dev/tools/Magento/Tools/View/deploy.php script.
  2. Switch from "default" or "developer" mode to "production" mode.

Good to know:
There are few configuration options available to configure bundling per theme (eg, app/design/adminhtml/Magento/backend/etc/view.xml)
When deploy script is running, we scan through entire Magento directory and assemble JavaScript files into bundles (according to variable option "js_bundle_size"). And there is another setting to specify a list of JavaScript files which should be excluded from bundling (so even if you make all right some files still will be loading asynchronously).

Since, the bundling feature is still in development, you won't find a documentation yet available. But within some nearest release it will be shipped to public resource.

If you need more details, you may ask questions here so far.

Thank you.

@vpelipenko
Copy link
Contributor

@craigcarnell, do you have another questions or we can close this issue?

@vpelipenko
Copy link
Contributor

Closed. There is no response from reporter. @craigcarnell, feel free to reopen if still have issues with JS minification .

@csdougliss
Copy link
Contributor Author

@vpelipenko When I enable the merge and bundling of JavaScript files in beta4, the admin system menu no longer responds. There is no errors in my console. It will not slide across.

I would preferably like frontend and back end merging/bundling being moved into separate menu options, as this can issue often occurs if there is a mistake in any javascript, stopping javascript running in the admin.

@vkorotun How do you switch to "production" mode?

@markshust
Copy link
Contributor

If anyone else comes across this post.....

./bin/magento deploy:mode:set production

@viktor-zhuromskyy
Copy link

When I have JS Bundling enabled, my .js file size has whopping 13+ MB!!! If I gzip it, it has 3+ MB, but that is a lot of slowdown time on first-page load and lots of bandwidth cut-off on each sach file load!

image 2016-05-01 15 03 44

@VegasJames
Copy link

I have the same problem as above. I've opened a new bug for it: 4506

@viktor-zhuromskyy
Copy link

And the
<vars module="Js_Bundle"> <var name="bundle_size">2MB</var> </vars>
in theme's view.xml is completely ignored!

magento-team pushed a commit that referenced this issue May 26, 2017
Fixed issues:
- MAGETWO-63054 [Catalog] MSRP field is not displayed for bundle products with fixed price
- MAGETWO-63154 Special characters in store name converted to numerical character references in email subject #8094
- MAGETWO-60692 [Github]Bundle product order - create invoice via REST API #6988
- MAGETWO-60514 The exchange rate in order is duplicated
- MAGETWO-64967 Export locks admin panel
- MAGETWO-67529 [Catalog] Configurable product visible on frontend when all child products are disabled
- MAGETWO-67574 [Catalog] Denied category is visible on SF
- MAGETWO-60628 [GITHUB] Refund report does not show right date #5317
- MAGETWO-69111 Customer custom address attributes lost after changing contact information and password
- MAGETWO-67745 The "Catalog Search indexer process unknown error" appears after reindex
- MAGETWO-64885 Wrong cookies set for store views with multidomain
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

8 participants