template-nestjs-svelte-tailwind-rollup Svelte Themes

Template Nestjs Svelte Tailwind Rollup

template-nestjs-svelte-tailwind-rollup

template-nestjs-svelte-tailwind-rollup by Wesley LEVASSEUR is licensed under CC BY-NC-SA 4.0

Explaination

Routify with Rollup will be able to build Svelte statically. This construction is located:

  • public/build/bundle.js
  • public/build/bundle.js.map
  • public/build/bundle.css

Tailwind being included in the project, manually and automatically the construction of the CSS is located:

  • public/build/tailwind.css

NestJS will be built in the folder(s):

  • dist
  • dist/api

In this template/project, we can see commons:

  • dist/commons

Our src will be composed like this:

  • src/api - Arranged this way in the project (aka server)
  • src/commons - (aka libs or lib)
  • src/pages - Required for Routify
  • src/svelte - Arranged this way in the project for Rollup (aka client)

Installation

# npx
$ npx degit git-init-wesley/template-nestjs-svelte-tailwind-rollup
# or yarn
$ yarn degit git-init-wesley/template-nestjs-svelte-tailwind-rollup

Step to production

# Install
$ npm install
# Or Clean Install
$ npm ci

# Build Application (NestJS + Svelte)
$ npm run build

# Start the application locally
$ npm run start

Dist

/dist/api/main - Node main path /dist/api - NestJS bundles /dist/commons - Commons

Public

/public/build/** - Bundles (editing is not recommended)

/public/index.html - Can be edited

/public/robots.txt - Can be edited

/public/assets/** - Can be edited

Running the app

# build
$ npm run build

# development
$ npm run dev

# tailwind
$ npm run tailwind

# tailwind + watch mode
$ npm run tailwind:watch

Running the nest app (Only nest)

# build
$ npm run build:api

# development
$ npm run start

# watch mode
$ npm run start:dev

# debug + watch mode
$ npm run start:debug

# production mode
$ npm run start:prod

Tests

Some example tests were created for this template.

# unit tests
$ npm run test
$ npm run test:watch

# e2e tests
$ npm run test:e2e
$ npm run test:e2e:watch

# test coverage
$ npm run test:cov

# test debug
$ npm run test:debug

# all tests (unit + e2e)
$ npm run test:all
$ npm run test:all:watch

Stay in touch

*Author - Wesley LEVASSEUR*

License

*This template is CC BY-NC-SA 4.0.*

Top categories

Loading Svelte Themes