mirror of
https://github.com/Sped0n/bridget.git
synced 2026-04-14 01:59:30 -07:00
Bump deps (#515)
* chore: add nix flake for reproducible dev environment Signed-off-by: Sped0n <hi@sped0n.com> * refactor: migrate SCSS to modern Sass (@use/@forward) Update mixins to use Sass module functions (map.has-key/get). Configure Vite for modern Sass API. Introduce _foundation.scss for forwarding core modules. Signed-off-by: Sped0n <hi@sped0n.com> * fix: replace deprecated _build with build in frontmatter Signed-off-by: Sped0n <hi@sped0n.com> * chore: add vcache.sh script for vercel build cache management Signed-off-by: Sped0n <hi@sped0n.com> * refactor: migrate to ESLint v9 flat config Remove legacy .eslintrc.json, .eslintignore, and .prettierrc.json. Add eslint.config.mjs with love, prettier, solid, and import rules. Update devDependencies (eslint@9, @typescript-eslint@8, etc.) and scripts. Minor TS fixes: remove eslint-disable, add error logging, simplify conditional. Signed-off-by: Sped0n <hi@sped0n.com> * chore: replace vcache.sh with vercel.sh for Vercel build process Delete vcache.sh script. Add vercel.sh: install Dart Sass v1.93.3, copy generated assets between node_modules and project dirs, run vite:build + hugo build, then copy back. Signed-off-by: Sped0n <hi@sped0n.com> * chore: setup dart-sass and split build steps in GitHub workflow Signed-off-by: Sped0n <hi@sped0n.com> --------- Signed-off-by: Sped0n <hi@sped0n.com>
This commit is contained in:
@@ -1,3 +0,0 @@
|
||||
node_modules
|
||||
static
|
||||
exampleSite
|
||||
@@ -1,64 +0,0 @@
|
||||
{
|
||||
"env": {
|
||||
"browser": true,
|
||||
"es2021": true
|
||||
},
|
||||
"extends": [
|
||||
"standard-with-typescript",
|
||||
"prettier",
|
||||
"eslint:recommended",
|
||||
"plugin:prettier/recommended",
|
||||
"plugin:@typescript-eslint/recommended",
|
||||
"plugin:solid/typescript"
|
||||
],
|
||||
"parser": "@typescript-eslint/parser",
|
||||
"plugins": ["prettier", "@typescript-eslint", "solid"],
|
||||
"parserOptions": {
|
||||
"ecmaVersion": "latest",
|
||||
"project": "./tsconfig.json",
|
||||
"sourceType": "module"
|
||||
},
|
||||
"rules": {
|
||||
"prettier/prettier": "error",
|
||||
"arrow-body-style": "off",
|
||||
"prefer-arrow-callback": "off",
|
||||
"import/no-cycle": "error",
|
||||
"sort-imports": [
|
||||
"error",
|
||||
{
|
||||
"ignoreCase": false,
|
||||
"ignoreDeclarationSort": true,
|
||||
"ignoreMemberSort": true,
|
||||
"memberSyntaxSortOrder": ["none", "all", "multiple", "single"],
|
||||
"allowSeparatedGroups": true
|
||||
}
|
||||
],
|
||||
"import/no-unresolved": "error",
|
||||
"import/order": [
|
||||
"error",
|
||||
{
|
||||
"groups": [
|
||||
"builtin",
|
||||
"external",
|
||||
"internal",
|
||||
"parent",
|
||||
"sibling",
|
||||
"index",
|
||||
"unknown"
|
||||
],
|
||||
"newlines-between": "always",
|
||||
"alphabetize": {
|
||||
"order": "asc",
|
||||
"caseInsensitive": true
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"settings": {
|
||||
"import/resolver": {
|
||||
"typescript": {
|
||||
"project": "./tsconfig.json"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
7
.github/workflows/build.yml
vendored
7
.github/workflows/build.yml
vendored
@@ -55,6 +55,9 @@ jobs:
|
||||
hugo-version: '0.114.0'
|
||||
extended: true
|
||||
|
||||
- name: Setup Dart Sass
|
||||
run: sudo snap install dart-sass
|
||||
|
||||
- name: Setup pnpm
|
||||
uses: pnpm/action-setup@v3
|
||||
with:
|
||||
@@ -82,7 +85,9 @@ jobs:
|
||||
run: pnpm install
|
||||
|
||||
- name: Build
|
||||
run: pnpm run build
|
||||
run: |
|
||||
pnpm run vite:build
|
||||
hugo --logLevel info --source=exampleSite --gc --minify
|
||||
|
||||
- name: Push artifacts
|
||||
if: ${{ (github.event_name == 'push' || github.event.pull_request.merged == true) && needs.filter.outputs.any_changed == 'true' }}
|
||||
|
||||
@@ -1,18 +0,0 @@
|
||||
{
|
||||
"useTabs": false,
|
||||
"tabWidth": 2,
|
||||
"printWidth": 88,
|
||||
"singleQuote": true,
|
||||
"trailingComma": "none",
|
||||
"bracketSpacing": true,
|
||||
"semi": false,
|
||||
"plugins": ["prettier-plugin-go-template", "prettier-plugin-organize-imports"],
|
||||
"overrides": [
|
||||
{
|
||||
"files": ["*.html"],
|
||||
"options": {
|
||||
"parser": "go-template"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
4
assets/scss/_core/_foundation.scss
Normal file
4
assets/scss/_core/_foundation.scss
Normal file
@@ -0,0 +1,4 @@
|
||||
@forward 'reset';
|
||||
@forward 'font';
|
||||
@forward 'typography';
|
||||
@forward 'mixins';
|
||||
@@ -1,3 +1,5 @@
|
||||
@use 'sass:map';
|
||||
|
||||
$breakpoints: (
|
||||
'mobile': 375px,
|
||||
'tablet': 768px,
|
||||
@@ -8,8 +10,8 @@ $breakpoints: (
|
||||
// Breakpoints
|
||||
|
||||
@mixin min-width($breakpoint) {
|
||||
@if map-has-key($breakpoints, $breakpoint) {
|
||||
@media (min-width: map-get($breakpoints, $breakpoint)) {
|
||||
@if map.has-key($breakpoints, $breakpoint) {
|
||||
@media (min-width: map.get($breakpoints, $breakpoint)) {
|
||||
@content;
|
||||
}
|
||||
} @else {
|
||||
@@ -18,8 +20,8 @@ $breakpoints: (
|
||||
}
|
||||
|
||||
@mixin max-width($breakpoint) {
|
||||
@if map-has-key($breakpoints, $breakpoint) {
|
||||
@media (max-width: (map-get($breakpoints, $breakpoint) - 1px)) {
|
||||
@if map.has-key($breakpoints, $breakpoint) {
|
||||
@media (max-width: (map.get($breakpoints, $breakpoint) - 1px)) {
|
||||
@content;
|
||||
}
|
||||
} @else {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
@import 'mixins';
|
||||
@use 'mixins' as *;
|
||||
|
||||
body {
|
||||
line-height: 1.2;
|
||||
|
||||
@@ -1,3 +1,9 @@
|
||||
@use 'sass:map';
|
||||
|
||||
@use '_core/mixins' as *;
|
||||
|
||||
$tablet: map.get($breakpoints, 'tablet') - 1;
|
||||
|
||||
article {
|
||||
padding: var(--space-standard);
|
||||
max-width: 25em;
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
$tablet: map-get($breakpoints, 'tablet') - 1;
|
||||
@use 'sass:map';
|
||||
|
||||
@use '_core/mixins' as *;
|
||||
|
||||
$tablet: map.get($breakpoints, 'tablet') - 1;
|
||||
|
||||
@media (max-width: $tablet), (hover: none) {
|
||||
.container {
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
$tablet: map-get($breakpoints, 'tablet') - 1;
|
||||
@use 'sass:map';
|
||||
|
||||
@use '_core/mixins' as *;
|
||||
|
||||
$tablet: map.get($breakpoints, 'tablet') - 1;
|
||||
|
||||
nav {
|
||||
display: flex;
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
@import '_core/mixins';
|
||||
|
||||
:root {
|
||||
--window-height: 100vh;
|
||||
--nav-height: 2rem;
|
||||
|
||||
@@ -1,12 +1,9 @@
|
||||
@charset "utf-8";
|
||||
|
||||
@import '_core/reset';
|
||||
@import '_core/font';
|
||||
@import '_core/typography';
|
||||
@import '_core/mixins';
|
||||
@import '_variables';
|
||||
@import '_core/base';
|
||||
@use '_core/foundation';
|
||||
@use '_variables';
|
||||
@use '_core/base';
|
||||
|
||||
@import '_partial/nav';
|
||||
@import '_partial/article';
|
||||
@import '_partial/container';
|
||||
@use '_partial/nav';
|
||||
@use '_partial/article';
|
||||
@use '_partial/container';
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
@charset "utf-8";
|
||||
|
||||
@import '_partial/customCursor';
|
||||
@import '_partial/stage';
|
||||
@import '_partial/stageNav';
|
||||
@use '_partial/customCursor';
|
||||
@use '_partial/stage';
|
||||
@use '_partial/stageNav';
|
||||
@use '_partial/collection';
|
||||
@use '_partial/gallery';
|
||||
|
||||
@import '_partial/collection';
|
||||
@import '_partial/gallery';
|
||||
|
||||
@import 'node_modules/swiper/swiper.scss';
|
||||
@use '../../node_modules/swiper/swiper.css';
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
// eslint-disable-next-line sort-imports
|
||||
import { Show, createMemo, createSignal, type JSX } from 'solid-js'
|
||||
|
||||
import type { ImageJSON } from '../resources'
|
||||
|
||||
@@ -135,7 +135,7 @@ export default function Stage(props: {
|
||||
}
|
||||
|
||||
const onClick: () => void = () => {
|
||||
!props.isAnimating() && props.setIsOpen(true)
|
||||
if (!props.isAnimating()) props.setIsOpen(true)
|
||||
}
|
||||
|
||||
const setPosition: () => void = () => {
|
||||
@@ -422,7 +422,6 @@ export default function Stage(props: {
|
||||
.catch(() => {
|
||||
void 0
|
||||
})
|
||||
// eslint-disable-next-line solid/reactivity
|
||||
.then(() => {
|
||||
// abort controller for cleanup
|
||||
abortController?.abort()
|
||||
|
||||
@@ -27,7 +27,8 @@ export async function getImageJSON(): Promise<ImageJSON[]> {
|
||||
}
|
||||
return 1
|
||||
})
|
||||
} catch (_) {
|
||||
} catch (e) {
|
||||
console.error(e)
|
||||
return []
|
||||
}
|
||||
}
|
||||
|
||||
@@ -112,7 +112,7 @@ menu:
|
||||
identifier: Erwitt
|
||||
title: Erwitt
|
||||
unifiedAlt: '© Elliott Erwitt'
|
||||
_build:
|
||||
build:
|
||||
publishResources: false
|
||||
---
|
||||
```
|
||||
|
||||
80
eslint.config.mjs
Normal file
80
eslint.config.mjs
Normal file
@@ -0,0 +1,80 @@
|
||||
import { default as eslint, default as js } from '@eslint/js'
|
||||
import tsParser from '@typescript-eslint/parser'
|
||||
import love from 'eslint-config-love'
|
||||
import importPlugin from 'eslint-plugin-import'
|
||||
import prettier from 'eslint-plugin-prettier/recommended'
|
||||
import solid from 'eslint-plugin-solid/configs/recommended'
|
||||
import { defineConfig, globalIgnores } from 'eslint/config'
|
||||
import tseslint from 'typescript-eslint'
|
||||
|
||||
export default defineConfig([
|
||||
js.configs.recommended,
|
||||
eslint.configs.recommended,
|
||||
tseslint.configs.recommended,
|
||||
importPlugin.flatConfigs.recommended,
|
||||
solid,
|
||||
globalIgnores(['**/node_modules', '**/static', '**/exampleSite', '*.mjs']),
|
||||
{
|
||||
...love,
|
||||
...prettier,
|
||||
|
||||
languageOptions: {
|
||||
parser: tsParser,
|
||||
ecmaVersion: 'latest',
|
||||
sourceType: 'module',
|
||||
|
||||
parserOptions: {
|
||||
project: './tsconfig.json'
|
||||
}
|
||||
},
|
||||
|
||||
settings: {
|
||||
'import/resolver': {
|
||||
typescript: {
|
||||
project: './tsconfig.json'
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
rules: {
|
||||
'prettier/prettier': 'error',
|
||||
'arrow-body-style': 'off',
|
||||
'prefer-arrow-callback': 'off',
|
||||
'import/no-cycle': 'error',
|
||||
|
||||
'sort-imports': [
|
||||
'error',
|
||||
{
|
||||
ignoreCase: false,
|
||||
ignoreDeclarationSort: true,
|
||||
ignoreMemberSort: true,
|
||||
memberSyntaxSortOrder: ['none', 'all', 'multiple', 'single'],
|
||||
allowSeparatedGroups: true
|
||||
}
|
||||
],
|
||||
|
||||
'import/no-unresolved': 'error',
|
||||
|
||||
'import/order': [
|
||||
'error',
|
||||
{
|
||||
groups: [
|
||||
'builtin',
|
||||
'external',
|
||||
'internal',
|
||||
'parent',
|
||||
'sibling',
|
||||
'index',
|
||||
'unknown'
|
||||
],
|
||||
'newlines-between': 'always',
|
||||
|
||||
alphabetize: {
|
||||
order: 'asc',
|
||||
caseInsensitive: true
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
])
|
||||
@@ -8,6 +8,6 @@ menu:
|
||||
identifier: Erwitt
|
||||
title: Erwitt
|
||||
unifiedAlt: '© Elliott Erwitt'
|
||||
_build:
|
||||
build:
|
||||
publishResources: false
|
||||
---
|
||||
|
||||
@@ -8,6 +8,6 @@ menu:
|
||||
identifier: Gruyaert
|
||||
title: Gruyaert
|
||||
unifiedAlt: '© Harry Gruyaert'
|
||||
_build:
|
||||
build:
|
||||
publishResources: false
|
||||
---
|
||||
|
||||
@@ -8,7 +8,7 @@ menu:
|
||||
identifier: Info
|
||||
title: Info
|
||||
unifiedAlt: ''
|
||||
_build:
|
||||
build:
|
||||
publishResources: false
|
||||
---
|
||||
|
||||
|
||||
@@ -8,6 +8,6 @@ menu:
|
||||
identifier: Webb
|
||||
title: Webb
|
||||
unifiedAlt: '© Alex Webb'
|
||||
_build:
|
||||
build:
|
||||
publishResources: false
|
||||
---
|
||||
|
||||
25
flake.lock
generated
Normal file
25
flake.lock
generated
Normal file
@@ -0,0 +1,25 @@
|
||||
{
|
||||
"nodes": {
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1762596750,
|
||||
"narHash": "sha256-rXXuz51Bq7DHBlfIjN7jO8Bu3du5TV+3DSADBX7/9YQ=",
|
||||
"rev": "b6a8526db03f735b89dd5ff348f53f752e7ddc8e",
|
||||
"revCount": 891611,
|
||||
"type": "tarball",
|
||||
"url": "https://api.flakehub.com/f/pinned/NixOS/nixpkgs/0.1.891611%2Brev-b6a8526db03f735b89dd5ff348f53f752e7ddc8e/019a684c-ea63-75fd-99cc-3b869954e5f9/source.tar.gz"
|
||||
},
|
||||
"original": {
|
||||
"type": "tarball",
|
||||
"url": "https://flakehub.com/f/NixOS/nixpkgs/0.1"
|
||||
}
|
||||
},
|
||||
"root": {
|
||||
"inputs": {
|
||||
"nixpkgs": "nixpkgs"
|
||||
}
|
||||
}
|
||||
},
|
||||
"root": "root",
|
||||
"version": 7
|
||||
}
|
||||
38
flake.nix
Normal file
38
flake.nix
Normal file
@@ -0,0 +1,38 @@
|
||||
{
|
||||
description = "bridget";
|
||||
inputs.nixpkgs.url = "https://flakehub.com/f/NixOS/nixpkgs/0.1";
|
||||
outputs =
|
||||
{ self, ... }@inputs:
|
||||
let
|
||||
supportedSystems = [
|
||||
"x86_64-linux"
|
||||
"aarch64-linux"
|
||||
"x86_64-darwin"
|
||||
"aarch64-darwin"
|
||||
];
|
||||
forEachSupportedSystem =
|
||||
f:
|
||||
inputs.nixpkgs.lib.genAttrs supportedSystems (
|
||||
system:
|
||||
f {
|
||||
pkgs = import inputs.nixpkgs { inherit system; };
|
||||
}
|
||||
);
|
||||
in
|
||||
{
|
||||
devShells = forEachSupportedSystem (
|
||||
{ pkgs }:
|
||||
{
|
||||
default = pkgs.mkShellNoCC {
|
||||
packages = with pkgs; [
|
||||
nodejs
|
||||
nodePackages.pnpm
|
||||
dart-sass
|
||||
hugo
|
||||
go
|
||||
];
|
||||
};
|
||||
}
|
||||
);
|
||||
};
|
||||
}
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
{{/* critical style */}}
|
||||
{{- $style := dict "Source" "scss/critical.scss" "Fingerprint" $fingerprint -}}
|
||||
{{- $options := dict "enableSourceMap" true "includePaths" (slice "node_modules") -}}
|
||||
{{- $options := dict "enableSourceMap" true "includePaths" (slice "node_modules") "transpiler" "dartsass" -}}
|
||||
{{- $style = dict "Context" . "ToCSS" $options "Inline" true | merge $style -}}
|
||||
{{- partial "plugin/style.html" $style -}}
|
||||
|
||||
|
||||
27
package.json
27
package.json
@@ -7,14 +7,14 @@
|
||||
"private": true,
|
||||
"sideEffects": false,
|
||||
"scripts": {
|
||||
"vite": "vite build --no-watch",
|
||||
"vite": "DISABLE_WATCH=1 vite build",
|
||||
"lint": "eslint . --fix && prettier --write .",
|
||||
"lint:check": "eslint . && prettier . --check",
|
||||
"dev": "run-p vite:dev hugo:dev",
|
||||
"build": "run-s vite:build hugo:build",
|
||||
"server": "run-p vite:server hugo:server",
|
||||
"vite:build": "vite build --no-watch --minify terser",
|
||||
"vite:server": "vite build --minify terser",
|
||||
"vite:build": "DISABLE_WATCH=1 vite build",
|
||||
"vite:server": "vite build",
|
||||
"vite:dev": "vite build --mode development --minify false",
|
||||
"hugo:build": "hugo --logLevel info --source=exampleSite --gc",
|
||||
"hugo:preview": "hugo --logLevel info --source=exampleSite -D --gc",
|
||||
@@ -39,32 +39,29 @@
|
||||
},
|
||||
"homepage": "https://github.com/Sped0n/bridget#readme",
|
||||
"devDependencies": {
|
||||
"@typescript-eslint/eslint-plugin": "^6.21.0",
|
||||
"@typescript-eslint/parser": "^6.21.0",
|
||||
"eslint": "^8.57.0",
|
||||
"@types/node": "^24.10.0",
|
||||
"@typescript-eslint/eslint-plugin": "^8.46.4",
|
||||
"@typescript-eslint/parser": "^8.46.4",
|
||||
"eslint": "^9.39.1",
|
||||
"eslint-config-love": "^133.0.0",
|
||||
"eslint-config-prettier": "^10.1.8",
|
||||
"eslint-config-standard": "^17.1.0",
|
||||
"eslint-config-standard-with-typescript": "^43.0.1",
|
||||
"eslint-import-resolver-typescript": "^4.4.4",
|
||||
"eslint-plugin-import": "^2.32.0",
|
||||
"eslint-plugin-n": "^16.6.2",
|
||||
"eslint-plugin-prettier": "^5.5.4",
|
||||
"eslint-plugin-promise": "^6.6.0",
|
||||
"eslint-plugin-solid": "^0.14.5",
|
||||
"npm-run-all": "^4.1.5",
|
||||
"prettier": "3.6.2",
|
||||
"prettier-plugin-go-template": "^0.0.15",
|
||||
"prettier-plugin-organize-imports": "^4.3.0",
|
||||
"sass": "^1.83.1",
|
||||
"terser": "^5.44.0",
|
||||
"sass": "^1.94.0",
|
||||
"typescript": "^5.9.3",
|
||||
"vite": "^5.4.21",
|
||||
"vite": "^7.2.2",
|
||||
"vite-plugin-solid": "^2.11.10"
|
||||
},
|
||||
"dependencies": {
|
||||
"gsap": "^3.13.0",
|
||||
"solid-js": "^1.9.9",
|
||||
"swiper": "^11.1.15",
|
||||
"solid-js": "^1.9.10",
|
||||
"swiper": "^12.0.3",
|
||||
"tiny-invariant": "^1.3.3"
|
||||
}
|
||||
}
|
||||
|
||||
1740
pnpm-lock.yaml
generated
1740
pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load Diff
23
prettier.config.mjs
Normal file
23
prettier.config.mjs
Normal file
@@ -0,0 +1,23 @@
|
||||
/**
|
||||
* @see https://prettier.io/docs/configuration
|
||||
* @type {import("prettier").Config}
|
||||
*/
|
||||
const config = {
|
||||
useTabs: false,
|
||||
tabWidth: 2,
|
||||
printWidth: 88,
|
||||
singleQuote: true,
|
||||
trailingComma: 'none',
|
||||
bracketSpacing: true,
|
||||
semi: false,
|
||||
plugins: ['prettier-plugin-go-template', 'prettier-plugin-organize-imports'],
|
||||
overrides: [
|
||||
{
|
||||
files: ['*.html'],
|
||||
options: {
|
||||
parser: 'go-template'
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
export default config
|
||||
@@ -11,7 +11,8 @@
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
"moduleResolution": "node",
|
||||
"jsx": "preserve",
|
||||
"jsxImportSource": "solid-js"
|
||||
"jsxImportSource": "solid-js",
|
||||
"types": ["node"]
|
||||
},
|
||||
"$schema": "https://json.schemastore.org/tsconfig",
|
||||
"display": "Recommended"
|
||||
|
||||
50
vercel.sh
Executable file
50
vercel.sh
Executable file
@@ -0,0 +1,50 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
node_modules_generated_dir="./node_modules/exampleSite/resources/_gen"
|
||||
project_generated_dir="./exampleSite/resources/_gen"
|
||||
dart_sass_version="1.93.3"
|
||||
dart_sass_install_dir="${HOME}/.local/dart-sass"
|
||||
dart_sass_tarball="dart-sass-${dart_sass_version}-linux-x64.tar.gz"
|
||||
dart_sass_download_url="https://github.com/sass/dart-sass/releases/download/${dart_sass_version}/${dart_sass_tarball}"
|
||||
|
||||
install_dart_sass() {
|
||||
echo "Installing Dart Sass ${dart_sass_version}..."
|
||||
mkdir -p "${HOME}/.local"
|
||||
curl -sSLO "${dart_sass_download_url}"
|
||||
rm -rf "${dart_sass_install_dir}"
|
||||
tar -C "${HOME}/.local" -xf "${dart_sass_tarball}"
|
||||
rm -f "${dart_sass_tarball}"
|
||||
export PATH="${dart_sass_install_dir}:${PATH}"
|
||||
}
|
||||
|
||||
copy_generated_assets_to_project() {
|
||||
if [ -d "${node_modules_generated_dir}" ]; then
|
||||
rm -rf "${project_generated_dir}"
|
||||
mkdir -p "${project_generated_dir}"
|
||||
cp -a "${node_modules_generated_dir}/." "${project_generated_dir}"
|
||||
echo "Copied '${node_modules_generated_dir}' to '${project_generated_dir}'."
|
||||
else
|
||||
echo "Source '${node_modules_generated_dir}' not found, skipping copy to project."
|
||||
fi
|
||||
}
|
||||
|
||||
run_site_build() {
|
||||
pnpm run vite:build && hugo --logLevel info --source=exampleSite --gc --minify
|
||||
}
|
||||
|
||||
copy_generated_assets_to_node_modules() {
|
||||
rm -rf "${node_modules_generated_dir}"
|
||||
if [ -d "${project_generated_dir}" ]; then
|
||||
mkdir -p "${node_modules_generated_dir}"
|
||||
cp -a "${project_generated_dir}/." "${node_modules_generated_dir}"
|
||||
echo "Copied '${project_generated_dir}' back to '${node_modules_generated_dir}'."
|
||||
else
|
||||
echo "Source '${project_generated_dir}' not found, skipping copy to node_modules."
|
||||
fi
|
||||
}
|
||||
|
||||
install_dart_sass
|
||||
copy_generated_assets_to_project
|
||||
run_site_build
|
||||
copy_generated_assets_to_node_modules
|
||||
@@ -5,9 +5,11 @@ export default defineConfig({
|
||||
plugins: [solidPlugin()],
|
||||
build: {
|
||||
outDir: './static/bundled',
|
||||
watch: {
|
||||
include: 'assets/**'
|
||||
},
|
||||
watch: process.env.DISABLE_WATCH
|
||||
? null
|
||||
: {
|
||||
include: 'assets/**'
|
||||
},
|
||||
rollupOptions: {
|
||||
input: './assets/ts/main.tsx',
|
||||
output: {
|
||||
@@ -17,13 +19,12 @@ export default defineConfig({
|
||||
assetFileNames: '[ext]/[name].[ext]',
|
||||
compact: true
|
||||
}
|
||||
},
|
||||
terserOptions: {
|
||||
compress: {
|
||||
passes: 3
|
||||
},
|
||||
output: {
|
||||
comments: false
|
||||
}
|
||||
},
|
||||
css: {
|
||||
preprocessorOptions: {
|
||||
scss: {
|
||||
api: 'modern'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user