refactor: migrate part of the sass compilation to vite (#283)

* refactor: migrate part of the sass compilation to vite

now `bundled` option is deprecated

* fix: update build script

* chore: add a “type” field to the package.json file to resolve Vite’s complaints about CommonJS modules.
This commit is contained in:
Spedon
2024-02-22 23:44:16 +08:00
committed by GitHub
parent 53a44776de
commit 875113448b
8 changed files with 82 additions and 25 deletions

View File

@@ -1,6 +1,7 @@
{
"name": "bridget",
"version": "v1.0.0",
"type": "module",
"description": "bridget theme source file",
"packageManager": "pnpm@8.10.2",
"private": true,
@@ -10,7 +11,7 @@
"lint": "eslint . --fix && prettier --write .",
"lint:check": "eslint . && prettier . --check",
"dev": "run-p vite:dev hugo:dev",
"build": "rm -f ./static/bundled/js/* && run-s vite:build hugo:build && yes | cp -rf ./exampleSite/public/css/*.css ./static/bundled/css",
"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",
@@ -54,6 +55,7 @@
"prettier": "3.2.5",
"prettier-plugin-go-template": "^0.0.15",
"prettier-plugin-organize-imports": "^3.2.4",
"sass": "^1.71.1",
"terser": "^5.27.0",
"typescript": "^5.3.3",
"vite": "^5.1.2",