-
Notifications
You must be signed in to change notification settings - Fork 10.3k
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
how can I deploy the sites to a CDN? #1369
Comments
With a static site you really want to deploy everything to a CDN. You're
site is significantly faster this way as html can be loaded from the CDN as
well as assets and you don't have to do multiple SSL negotiations. Perhaps
we can add support for this style of deployment but in the meantime,
there's plenty of static hosts that'll put everything for you on a CDN.
…On Tue, Jul 4, 2017, 8:59 PM magicly ***@***.***> wrote:
hi, I want to deploy all files(including pics/js/css/font) except
index.html to my CDN, e.g. http://cdn.example.com, but deploy index.html
to my main site: http://www.example.com. Is it possible? I work around
for several hours, including set
pathPrefix: 'http://cdn.example.com'
in gatsby-config.js.
or modify webpack config in gatsby-node.js
exports.modifyWebpackConfig = ({config, stage}) => {
config.merge({
output: {
publicPath: 'http://localhost:50000000000/',
}
})
return config;
}
In create-react-app, I just need to set PUBLIC_URL and in webpack I just
need to set publicPath in output.
Is there sth I missing? Any help is welcome. Thanks~
I use https://github.com/gatsbyjs/gatsby-starter-blog/tree/1.0 as a
starter, so the package.json file is the same.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#1369>, or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAEVhxjGJ4biLERltkzcPTt3-CpCdBVoks5sKwoSgaJpZM4ON1Y5>
.
|
Netlify is a good option if you're looking for something hosted. They also have an auto-deploy feature that knows how to build Gatsby sites so you don't have to set up CI. |
For anyone else who wanders on this issue, this can now be achieved using the |
This was referenced Apr 20, 2021
This was referenced Sep 8, 2021
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
hi, I want to deploy all files(including pics/js/css/font) except index.html to my CDN, e.g. http://cdn.example.com, but deploy index.html to my main site: http://www.example.com. Is it possible? I work around for several hours, including set
pathPrefix: 'http://cdn.example.com'
in gatsby-config.js.
or modify webpack config in gatsby-node.js
In create-react-app, I just need to set PUBLIC_URL and in webpack I just need to set publicPath in output.
Is there sth I missing? Any help is welcome. Thanks~
I use https://github.com/gatsbyjs/gatsby-starter-blog/tree/1.0 as a starter, so the package.json file is the same.
The text was updated successfully, but these errors were encountered: