3

I created custom module with requirejs-config.js and js folder when ever page loads requirejs-config is dynamically created in pub/static/_requirejs folder, but my custom JS is not created automatically i need to copy paste manually in my local system

Do magento2 have any command to build pub/static JS files or manually we need to move into pub\static\frontend\Magento\luma\en_US\MYNAME_MYMODULE\js

i tried below command but not working

bin\magento setup:static-content:deploy

2 Answers 2

3

First, please ensure that you module properly installed.

If you work in developer mode, files materialized by request, so no needs in any command. bin/magento setup:static-content:deploy need only for production mode, where assume that filesystem readonly (see: docs). To identify with mode you use, you can run command bin/magento deploy:mode:show

See more details in official documentation

1

Magento 2 copies the browser resources (JavaScript, CSS) to the pub/static folder automatically without any console commands.
If your files have not been copied, then you did something wrong. Maybe, you placed the files in a wrong location. Use a core module as an example and do carefully the same.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.