Coder Social home page Coder Social logo

swiper's Introduction

NxNextjs

This project was generated using Nx (v14.5.10)

ℹ️  use the node.js v16 LTS

Goal

  • check how the Next.js works with Nx

  • define shared components and use on the applications

  • define shared assets (also webfonts) to use on the applications

  • load the webfont added to the nx workspace and define to use it on the root tailwind.config.js

Documentation

Project dependency graph

nx dep-graph

implicit - means some sort of manual configuration

Findings

  • it was possible to use the TailwindCSS with SASS inside of the nx workspace

  • it was possible use the Next.js v10 though the Nx Next.js Plugin

    • the Next.js files when we run the development mode, they were place on the dists/apps/{app name}/

      • when we run the build it updates the same folder

      • when we run the export to get the static version, that's generates a inner folder /exported

CLI Commands

  • cleanup cache and dist: npm run clean
  • development: nx serve nextjs

  • build: nx build nextjs

    • with the flag --prod that will do the optimizations for production

    • with the NODE_ENV=production that will trigger the Tailwind css purge

  • test builded: npx serve dist/apps/app

  • lint: nx lint app

  • jsUnit tests: nx test app

  • e2e tests: nx e2e app-e2e

  • development: nx serve nextjs

  • build: nx build nextjs

    • with the NODE_ENV=production that will trigger the Tailwind css purge

    • in case of deployment with the server side support from the Next.js, you need to the the current content from the folder dist/apps/nextjs

  • test builded: nx serve nextjs --prod

    • this will work only after run the build
  • export: nx export nextjs

    • with the NODE_ENV=production that will trigger the Tailwind css purge

    • NODE_ENV=production nx export nextjs --prod

  • test exported: npx serve dist/apps/nextjs/exported

  • lint: nx lint nextjs

  • jsUnit tests: nx test nextjs

  • e2e tests: nx e2e nextjs-e2e

shared-components - storybook - nx storybook plugin

  • storybook: nx storybook shared-components

  • build: nx build-storybook shared-components

    • with the NODE_ENV=production that will trigger the Tailwind css purge
  • test builded: npx serve dist/storybook/shared-components

  • lint: nx lint shared-components

  • jsUnit tests: nx test shared-components

Links

Development tip

  • to make my life easier I have the current node_modules from the project mapped to the PATH env variable, that enables me to run the command nx directly, if you don't have if you must use the short cut mapped on the package.json, using it like npm run nx ... or it's also possible to use like npx nx ... (the npx will look into the local installed packages ./node_modules/ and on the global installed packages)

    • ./node_modules/.bin

Known issues on MacOS

swiper

swiper's People

Watchers

Alexandr Matyka avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.