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

Zeit Now 2.0 example? #900

Closed
ukyiwin opened this issue Jan 27, 2019 · 7 comments
Closed

Zeit Now 2.0 example? #900

ukyiwin opened this issue Jan 27, 2019 · 7 comments

Comments

@ukyiwin
Copy link

ukyiwin commented Jan 27, 2019

No description provided.

@jaredpalmer
Copy link
Owner

jaredpalmer commented Feb 5, 2019

Feel free to open a PR

@Siilwyn
Copy link

Siilwyn commented Feb 20, 2019

Think this would replace the current Now example since 1.0 seems to be on its way out.

@chrisdrackett
Copy link

I came here to open then as I am getting a build error currently when using @now/node-server. Has anyone else had luck getting razzle to build on now?

@stale stale bot removed the stale label May 11, 2019
@revskill10
Copy link

@chrisdrackett It's not hard .
BUT in my case, i have to "prebuild" the app with manual ncc , instead of using now as CI.

@chrisdrackett
Copy link

yeah, I can get it going with a pre-build, but I'd much rather build on deploy if possible

@lessp
Copy link

lessp commented Jun 18, 2019

hmm, I can't figure out a reasonable way to pre-build it. @revskill10, you said something about ncc, would you mind elaborating?

@bausk
Copy link

bausk commented Jun 22, 2019

@lessp ncc is Zeit's transpiler for Node.js that bundles dependencies into a single file, it can be run locally as an npm script and, to my understanding, works similarly to Zeit's builders like @now/node and @now/node-server.

I have just tried using it to deploy Razzle and found it to be just repetition of the standard Zeit build process, at least for the standard Razzle template with no dependencies. Here's my now.json, for reference:

{
    "version": 2,
    "name": "example",
    "builds": [
        {
            "src": "build/public/**",
            "use": "@now/static"
        },
        {
            "src": "build/server.js",
            "use": "@now/node-server"
        }
    ],
    "routes": [
        { "src": "/assets.json", "dest": "build/assets.json" },
        { "src": "/favicon.ico", "dest": "build/public/favicon.ico" },
        { "src": "/robots.txt", "dest": "build/public/robots.txt" },
        { "src": "/static/(.*)", "dest": "build/public/static/$1" },
        { "src": "/(.*)", "dest": "build/server.js" }
        
    ]
}

Maybe someone knows how to get rid of these abominations of routes BTW.

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

7 participants