diff --git a/pynecone/utils/build.py b/pynecone/utils/build.py index eaf5670a4..9fb97b673 100644 --- a/pynecone/utils/build.py +++ b/pynecone/utils/build.py @@ -126,6 +126,12 @@ def setup_frontend(root: Path): Args: root: root path of the project. """ + # Initialize the web directory if it doesn't exist. + web_dir = prerequisites.create_web_directory(root) + + # Install frontend packages + prerequisites.install_frontend_packages(web_dir) + # copy asset files to public folder path_ops.mkdir(str(root / constants.WEB_ASSETS_DIR)) path_ops.cp( diff --git a/pynecone/utils/exec.py b/pynecone/utils/exec.py index eb097ff4d..e76fbc653 100644 --- a/pynecone/utils/exec.py +++ b/pynecone/utils/exec.py @@ -38,12 +38,6 @@ def run_frontend(app: App, root: Path, port: str): root: root path of the project. port: port of the app. """ - # Initialize the web directory if it doesn't exist. - web_dir = prerequisites.create_web_directory(root) - - # Install frontend packages - prerequisites.install_frontend_packages(web_dir) - # Set up the frontend. setup_frontend(root)