-
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #853 from AlexsLemonade/arielsvn/844-server-side-r…
…endering Add server side rendering
- Loading branch information
Showing
169 changed files
with
6,111 additions
and
5,687 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"presets": ["next/babel"], | ||
"plugins": [] | ||
} |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
module.exports = { | ||
preset: 'jest-puppeteer', | ||
testRegex: './*\\.test\\.js$', | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
const path = require('path'); | ||
const withSass = require('@zeit/next-sass'); | ||
const withImages = require('next-images'); | ||
const withBundleAnalyzer = require('@next/bundle-analyzer')({ | ||
enabled: process.env.ANALYZE === 'true', | ||
}); | ||
|
||
const ApiHost = process.env.REACT_APP_API_HOST || 'https://api.refine.bio'; | ||
|
||
module.exports = withImages( | ||
withSass( | ||
withBundleAnalyzer({ | ||
target: 'serverless', | ||
env: { | ||
REACT_APP_API_HOST: ApiHost, | ||
}, | ||
webpack: (config, { isServer, dev, webpack }) => { | ||
// add custom webpack config only for the client side in production | ||
if (!isServer && !dev) { | ||
// ignore momentjs locales | ||
config.plugins.push( | ||
new webpack.IgnorePlugin(/^\.\/locale$/, /moment$/) | ||
); | ||
|
||
// lodash is referenced by multiple libraries, this makes sure we only | ||
// inlcude it once | ||
config.resolve.alias = { | ||
...config.resolve.alias, | ||
lodash: path.resolve(__dirname, 'node_modules/lodash'), | ||
}; | ||
|
||
config.optimization.splitChunks = { | ||
chunks: 'all', | ||
cacheGroups: { | ||
default: false, | ||
vendors: false, | ||
commons: { | ||
name: 'commons', | ||
chunks: 'all', | ||
minChunks: 3, | ||
}, | ||
charts: { | ||
name: 'charts', | ||
chunks: 'all', | ||
test: /[\\/]node_modules[\\/](recharts|d3.*)[\\/]/, | ||
enforce: true, | ||
priority: 10, | ||
}, | ||
// Only create one CSS file | ||
styles: { | ||
name: `styles`, | ||
// This should cover all our types of CSS. | ||
test: /\.(css|scss|sass)$/, | ||
chunks: `all`, | ||
enforce: true, | ||
// this rule trumps all other rules because of the priority. | ||
priority: 10, | ||
}, | ||
}, | ||
}; | ||
} | ||
return config; | ||
}, | ||
}) | ||
) | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.