Skip to content

Instantly share code, notes, and snippets.

@vovayatsyuk
Last active November 11, 2019 19:04
Show Gist options
  • Save vovayatsyuk/ddb0ad093cdb574713ac to your computer and use it in GitHub Desktop.
Save vovayatsyuk/ddb0ad093cdb574713ac to your computer and use it in GitHub Desktop.
Magento2 development snippets

Search Patterns

Css
app/design/frontend/Magento,lib/web/css,*.less,-**/docs/*

Clear preprocessed and generated scripts and styles

Remove old css and less files, to regenerate css

Module css

find pub/static var/view_preprocessed -type d -regex ".*MODULE_NAME.*css" -exec rm -rf {} \;

Theme css (when grunt is not available)

find pub/static var/view_preprocessed -type f -regex ".*styles-.*css" -exec rm -rf {} \;
Remove requirejs-config.js, to include new js files
rm -rf pub/static/_requirejs

Tests

cd <magento-root>/dev/tests/unit
<magento-root>/vendor/bin/phpunit --filter AnchorRendererTest

# js tests
grunt spec:blank dev/tests/js/jasmine/tests/app/code/Magento/Braintree/frontend/js/view/payment/method-renderer/paypal.test.js
@0m3r
Copy link

0m3r commented Mar 13, 2018

find pub/static var/view_preprocessed -type f -regex ".*styles-.*css" -exec rm -rf {} ;
find pub/static var/view_preprocessed -type f -regex ".styles-..css" -exec rm -rf {} ;

add . before css in regex

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment