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.
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 notifications@github.com 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 setpathPrefix: 'http://cdn.example.com'
in gatsby-config.js.
or modify webpack config in gatsby-node.jsexports.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
https://github.com/gatsbyjs/gatsby/issues/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.
Most helpful comment
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.