From 18a518d2f2a9fa665c3f06d56259d92abe3dad32 Mon Sep 17 00:00:00 2001 From: MisaLiu Date: Tue, 22 Aug 2023 20:01:09 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=20package.json=20=E4=BB=A5?= =?UTF-8?q?=E5=8F=8A=20Github=20Actions=20Workflow?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/webpack.yml | 16 ++++------------ package.json | 8 +++++--- 2 files changed, 9 insertions(+), 15 deletions(-) diff --git a/.github/workflows/webpack.yml b/.github/workflows/webpack.yml index 33aa82a..4c899d7 100644 --- a/.github/workflows/webpack.yml +++ b/.github/workflows/webpack.yml @@ -3,8 +3,6 @@ name: Build test page to GitHub Pages on: push: branches: [ "master" ] - pull_request: - branches: [ "master" ] workflow_dispatch: inputs: tags: @@ -39,11 +37,6 @@ jobs: - name: Setup Pages uses: actions/configure-pages@v2 - - name: Replace current git hash to HTML - run: | - sed -i 's/{{CURRENT_HASH}}/${{ github.sha }}/g' ./public/index.html - sed -i 's/{{CURRENT_HASH}}/${{ github.sha }}/g' ./public/sw.js - - name: Build webpack run: | npm install @@ -58,17 +51,16 @@ jobs: with: environment: production version: ${{ github.sha }} - sourcemaps: './dist' + sourcemaps: + - './dist' + - './dist/assets' set_commits: skip ignore_missing: true - - - name: Copy JavaScript to /public - run: cp -rf ./dist/* ./public/ - name: Upload artifact uses: actions/upload-pages-artifact@v1 with: - path: './public' + path: './dist' - name: Deploy to GitHub Pages id: deployment diff --git a/package.json b/package.json index 383c88c..5a13d46 100644 --- a/package.json +++ b/package.json @@ -8,14 +8,16 @@ ], "main": "src/main.js", "scripts": { - "dev": "npx webpack-dev-server --mode=development --progress --color", - "build": "npx webpack --mode=production" + "dev": "npx vite", + "dev:prod": "npx vite --mode production", + "build": "npx vite build", + "build:dev": "npx vite build --mode development" }, "repository": { "type": "git", "url": "https://github.com/MisaLiu/phi-chart-render.git" }, - "license": "MIT License", + "license": "LGPL-3.0-or-later", "bugs": { "url": "https://github.com/MisaLiu/phi-chart-render/issues" },