Skip to content

Commit

Permalink
Merge pull request #2028 from wellcometrust/next_poc
Browse files Browse the repository at this point in the history
add skeletal next app sharing code with the rest of the stack
  • Loading branch information
jamesgorrie committed Jan 17, 2018
2 parents 81feffa + 0c12b9f commit 2e407b4
Show file tree
Hide file tree
Showing 7 changed files with 4,820 additions and 0 deletions.
1 change: 1 addition & 0 deletions catalogue/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.next/
21 changes: 21 additions & 0 deletions catalogue/webapp/next.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
const path = require('path');
const nextPagesDir = path.resolve(__dirname, 'node_modules', 'next', 'dist', 'pages');

module.exports = {
webpack: (config, { buildId, dev }) => {
config.module.rules.forEach(rule => {
// recreating this until this is merged:
// https://github.com/zeit/next.js/commit/d4b1d9babfb4b9ed4f4b12d56d52dee233e862da
if (rule.exclude) {
rule.exclude = (str) => {
if (str.match('@wellcomecollection/')) {
return false;
}
return /node_modules/.test(str) && str.indexOf(nextPagesDir) !== 0;
}
}
});
config.resolve.symlinks = false;
return config;
}
};
14 changes: 14 additions & 0 deletions catalogue/webapp/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"scripts": {
"dev": "next -p 3001",
"build": "next build",
"start": "next start",
"postinstall": "pushd ../../common && yarn link && popd && yarn link @wellcomecollection/common"
},
"dependencies": {
"next": "^4.2.3",
"react": "^16.2.0",
"react-dom": "^16.2.0",
"@wellcomecollection/common": "file:../../common"
}
}
10 changes: 10 additions & 0 deletions catalogue/webapp/pages/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import {grid} from '@wellcomecollection/common/classnames';

export default () => (
<div className={grid({
s:12,
m:12,
l:12,
xl:12
})}>Catalogue</div>
)
Loading

0 comments on commit 2e407b4

Please sign in to comment.