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

Some guilds about deploying in production? #60

Closed
chrisyue opened this issue Jun 28, 2017 · 1 comment
Closed

Some guilds about deploying in production? #60

chrisyue opened this issue Jun 28, 2017 · 1 comment

Comments

@chrisyue
Copy link

chrisyue commented Jun 28, 2017

Hello guys, I am totally new to encore and yarn. I follow the doc in symfony.com to begin managing assets with encore. However, there are something I am not sure when I deploy to a production server, like: should I run yarn install --production? how can I compress js file? A documentation or a guild about doploying in production in detail will be nice to us newbies

@weaverryan
Copy link
Member

Hey @chrisyue!

This is a good idea. Some pointers to help you for now:

  1. Run ./node_modules/.bin/encore production before / during deploying to create your final .js and .css files
  2. You don't need to deploy the node_modules directory at all. So if you run encore before deploying, you can just deploy the final web/build directory and not deploy the node_modules directory. That's why you don't need to worry about running anything like yarn install --production: all of the npm packages and Encore stuff is not needed on production at all (only the finished files in the build directory are needed).
  3. When you run ./node_modules/.bin/encore production, all of your .js and .css files should be compressed automatically :).

I've just created a docs issue: symfony/symfony-docs#8094. If you have any other questions, can you ask on there? I'm sure other people will have the same questions, so it'll help us answer all of them.

Cheers!

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

2 participants