Roots Discourse

Why does Sage 9 deployment include e.g. config and scss files

The instructions read

run composer install --no-dev in your theme directory. Upload all files and folders in your theme except the node_modules directory to your host.

This results in an excessive amount of uploading, in particular for the resources/assets which is all or mostly already in the /dist directory.

Its my problem but I were to upload all of the root directory then that would include my .env file too.

It feels to me like there should be better division between dev and production assets. I can see that php files sit in both of course.

Anyone found better ways around this?

My preference would be to put the theme in a private git repo and use .gitignore. Here’s mine:

# Include your project-specific ignores in this file
# Read about how to use .gitignore: https://help.github.com/articles/ignoring-files
.cache-loader
.editorconfig
.eslintrc.js
.stylelintrc.js
CHANGELOG.md
CODE_OF_CONDUCT.md
LICENSE.md
README.md
phpcs.xml
yarn.lock
composer.json
composer.lock
package-lock.json
package.json
deploy.sh
node_modules
npm-debug.log
yarn-error.log
resources/assets

I also have a bash script that chains multiple commands:

#!/bin/bash

cd /var/www/html/web/app/themes/demyx
yarn build:production

if [[ "$?" != 0 ]]; then
    exit 1
elif [[ "$1" = push ]]; then
    git push
else
    composer install --no-dev
    git add .
    git commit -m "$1"
    git push
    composer install
fi