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

Can you describe some moments? #13

Open
Hector68 opened this issue Apr 9, 2020 · 3 comments
Open

Can you describe some moments? #13

Hector68 opened this issue Apr 9, 2020 · 3 comments

Comments

@Hector68
Copy link
Contributor

Hector68 commented Apr 9, 2020

Could you give some comments about a deploy process?

  1. Command magepack generate --cms-url="{{CMS_PAGE_URL}}" --category-url="{{CATEGORY_PAGE_URL}}" --product-url="{{PRODUCT_PAGE_URL}}" need run BEFORE bin/magento config:set dev/js/enable_magepack_js_bundling 1 or i can run command after too ?
    1.1 This command mast run only once?

  2. If I use a site in production mode. How to set this settings:

dev/js/merge_files
dev/js/enable_js_bundling
dev/js/minify_files
@elfeffe
Copy link

elfeffe commented Apr 10, 2020

Yes, some documentation is needed.
For example, the bundles are created in pub/static/content
That will be deleted after a bin/magento setup:upgrade, so it must run after that.
So magepack must run directly on the production server after setup:upgrade and setup:static-content:deploy?

@gaiterjones
Copy link

You can run the magepack generate command on your magento host or on any system to generate the magepack.config.js file. I copied this file to my magento root folder.

After installing the patches, magepack magento module and doing bin/magento s:up I enabled it with bin/magento config:set dev/js/enable_magepack_js_bundling 1 and then did

  • bin/magento setup:static-content:deploy --force
  • magepack bundle
  • bin/magento c:c

I guess I would need to do these three steps after any changes or upgrades that clear static content. I have tested this in both dev and production modes.

The results with pagespeed are very impressive so far.

screenshot_02

@vbuck
Copy link

vbuck commented Apr 10, 2020

As far as I understand, Magepack is a tool meant for production builds. As such, you should only be using it in a production-mode context.

The project README does appear to be written sequentially, although actual order can vary a little. I've described the process which seems to work best for me and likely for builds in a CD pipeline in another project:

Adding relevant details here also:

composer require creativestyle/magesuite-magepack
bin/magento setup:upgrade
bin/magento config:set dev/js/enable_magepack_js_bundling 1
bin/magento config:set dev/js/enable_js_bundling 0
bin/magento config:set dev/js/minify_files 1
bin/magento config:set dev/static/sign 1
bin/magento config:set dev/js/merge_files 1
bin/magento config:set dev/js/move_script_to_bottom 1
bin/magento config:set dev/css/merge_css_files 1
bin/magento config:set dev/css/minify_files 0
bin/magento config:set dev/css/use_css_critical_path 1
bin/magento config:set dev/template/minify_html 1
bin/magento cache:enable
bin/magento deploy:mode:set production
magepack generate --cms-url="…
magepack bundle

This deviates from the order of the Magepack README a bit, but works nonetheless. Some of my settings here are different from what you may use.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants