Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: add vite support #559

Merged
merged 14 commits into from
May 3, 2024
Merged
Show file tree
Hide file tree
Changes from 11 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ jobs:

strategy:
matrix:
node-version: [16]
node-version: [20]
python-version: ['3.9']
include:
- node-version: '16'
- node-version: '20'
python-version: '3.9'

steps:
Expand Down Expand Up @@ -44,12 +44,12 @@ jobs:
strategy:
fail-fast: false
matrix:
node-version: [16]
node-version: [20]
python-version: ['3.9']
aw-server: ["aw-server", "aw-server-rust"]
aw-version: ["v0.12.3b11"]
include:
- node-version: '16'
- node-version: '20'
python-version: '3.9'
aw-server: "aw-server-rust"
aw-version: "master"
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ coverage-ts
screenshots
test/unit/coverage
test/e2e/reports
*.map

# platform-specific trash
.DS_Store
Expand Down
6 changes: 6 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@ endif
build: install static/logo.png static/logo.svg
npm run build ${androidflag}

vite-build:
npx vite build

vite-dev:
npx vite

static/logo.%: media/logo/logo.%
@mkdir -p static
cp $< $@
Expand Down
5 changes: 5 additions & 0 deletions babel.config.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module.exports = {
presets: ['@vue/cli-plugin-babel/preset'],
plugins: ['lodash', '@babel/plugin-proposal-nullish-coalescing-operator'],
comments: false,
};
9 changes: 0 additions & 9 deletions babel.config.js

This file was deleted.

5 changes: 3 additions & 2 deletions src/index.html → index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,17 @@
<head>
<meta charset="utf-8">
<title>ActivityWatch</title>
<link rel="icon" type="image/png" href="/static/logo.png">
<link rel="icon" type="image/png" href="/logo.png">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<!-- Verify with https://csp-evaluator.withgoogle.com/ -->
<!-- TODO: fix CSP (should depend on prod/dev mode, as pre-vite )-->
<meta http-equiv="Content-Security-Policy" content="default-src 'self' <%= htmlWebpackPlugin.options.templateParameters.cspDefaultSrc %> https://api.github.com/repos/ActivityWatch/activitywatch/releases/latest; img-src 'self' data:; font-src 'self' data:; style-src 'self' 'unsafe-inline'; object-src 'none'; script-src 'self' 'unsafe-eval'">
</head>
<body>
<noscript>
<strong>We're sorry but the ActivityWatch Web UI doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
</noscript>
<div id="app"></div>
<!-- built files will be auto injected -->
<script type="module" src="/src/main.js"></script>
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thought this would mess up the webpack build... But seems to work.

</body>
</html>
File renamed without changes.
Loading
Loading