Skip to content

laborci/svelte-project

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Svelte skeleton with Rollup

npm run build

  • builds production files
  • copies the font files
  • increases the build version number

npm run dev

  • builds dev files
  • increases the build version number

Custom Rollup plugins

font-copy

Copies font files from node_modules to elsewhere. Fonts must be in the dependencies in the package.json file. It will copy fontawesome free/pro fonts and all @fontsource fonts installed.

fontCopy(target, root = null)
  • target - target directory
  • root - where the node_modules folder can be found. Default: current working directory

Import fontawesome fonts

$fontDirectory: "fonts/";

@import "@fortawesome/fontawesome-free/scss/variables";
$fa-font-path: $fontDirectory + "fontawesome-free";
@import "@fortawesome/fontawesome-free/scss/brands";
@import "@fortawesome/fontawesome-free/scss/solid";
@import "@fortawesome/fontawesome-free/scss/fontawesome";

Import fontsource fonts

@use "@fontsource/baloo-da-2/scss/mixins" as BalooDa2;

@include BalooDa2.fontFace($fontDir: $fontDirectory + "baloo-da-2", $weight: 400);
@include BalooDa2.fontFace($fontDir: $fontDirectory + "baloo-da-2", $weight: 800);

build-number

Can write a build number (based on the current timestamp) into several places.

bump

BuildNumber.bump(packageJson = null, key = "build-number")

Updates the build number value in the package json file

  • packageJson - the file to be updated. Default: cwd + package.json
  • key - the key to be updated

inject

BuildNumber.inject(file, pattern = /__BUILD_NUMBER__/g, replace = (version) => version.toString())

Injects to the build number into a file

  • file - to be modified
  • pattern - regex pattern to replace
  • replace - the replace function

write

BuildNumber.write(file)

Writes the build number into a file

  • file - to be written

touch

BuildNumber.touch(file)

Touches a file

  • file - to be touched

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published