This is an example Create Next App + Webpack 5 project with Cypress component testing.
yarn
to install the dependenciesnpx cypress open-ct
to run interactivelynpx cypress run-ct
to run all tests headlessly
The following was done to create this example:
- Initialize a baseline "nested-components" project in the create-next-app-webpack-5 subdirectory
npx create-next-app --example nested-components create-next-app-webpack-5
cd create-next-app-webpack-5
- Commit
3bdf444
- Enable Webpack 5
- Update next.config.js
- Commit
276c026
- Add Cypress component testing support with sample tests
yarn add -D cypress @cypress/react @cypress/webpack-dev-server webpack-dev-server@3 html-webpack-plugin@5
- Add cypress.json
- Add cypress/plugins/index.js
- Add components/paragraph.spec.ct.js, components/post.spec.ct.js, pages/index.spec.ct.js
npx cypress open-ct
- Commit
2789ebd
This example was generated by create-next-app-webpack-5.sh on 2021-05-26. The original README follows.
Taking advantage of the composable nature of React components we can modularize our apps in self-contained, meaningful components. This example has a page under pages/index.js
that uses components/paragraph.js
and components/post.js
that can be styled and managed separately.
Deploy the example using Vercel:
Execute create-next-app
with npm or Yarn to bootstrap the example:
npx create-next-app --example nested-components nested-components-app
# or
yarn create next-app --example nested-components nested-components-app
Deploy it to the cloud with Vercel (Documentation).