sforkowany z mirror/soapbox
Vite: preliminary setup
rodzic
f02e8cf282
commit
6543bf440f
|
@ -5,7 +5,6 @@
|
|||
<meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover, user-scalable=no">
|
||||
<meta name="mobile-web-app-capable" content="yes">
|
||||
<meta name="apple-mobile-web-app-capable" content="yes">
|
||||
<meta name="referrer" content="same-origin" />
|
||||
<link href="/manifest.json" rel="manifest">
|
||||
<!--server-generated-meta-->
|
||||
<%= snippets %>
|
||||
|
|
|
@ -0,0 +1,24 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover, user-scalable=no">
|
||||
<meta name="mobile-web-app-capable" content="yes">
|
||||
<meta name="apple-mobile-web-app-capable" content="yes">
|
||||
<link href="/manifest.json" rel="manifest">
|
||||
<!--server-generated-meta-->
|
||||
<script type="module" src="./soapbox/main.tsx"></script>
|
||||
</head>
|
||||
<body class="theme-mode-light no-reduce-motion">
|
||||
<div id="soapbox" class="h-full">
|
||||
<div class="loading-indicator-wrapper">
|
||||
<div class="loading-indicator">
|
||||
<div class="loading-indicator__container">
|
||||
<div class="loading-indicator__figure"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<noscript>To use this website, please enable JavaScript.</noscript>
|
||||
</body>
|
||||
</html>
|
|
@ -2,6 +2,7 @@
|
|||
"name": "soapbox",
|
||||
"displayName": "Soapbox",
|
||||
"version": "3.1.0",
|
||||
"type": "module",
|
||||
"description": "Soapbox frontend for the Fediverse.",
|
||||
"homepage": "https://soapbox.pub/",
|
||||
"repository": {
|
||||
|
@ -16,9 +17,9 @@
|
|||
"url": "https://gitlab.com/soapbox-pub/soapbox/-/issues"
|
||||
},
|
||||
"scripts": {
|
||||
"start": "npx webpack-dev-server",
|
||||
"start": "npx vite serve",
|
||||
"dev": "${npm_execpath} run start",
|
||||
"build": "npx webpack",
|
||||
"build": "npx vite build",
|
||||
"audit:fix": "npx yarn-audit-fix",
|
||||
"manage:translations": "npx ts-node ./scripts/translationRunner.ts",
|
||||
"test": "npx cross-env NODE_ENV=test npx jest",
|
||||
|
@ -96,6 +97,7 @@
|
|||
"@types/webpack-assets-manifest": "^5.1.0",
|
||||
"@types/webpack-bundle-analyzer": "^4.6.0",
|
||||
"@types/webpack-deadcode-plugin": "^0.1.2",
|
||||
"@vitejs/plugin-react": "^3.0.1",
|
||||
"autoprefixer": "^10.4.2",
|
||||
"axios": "^1.2.2",
|
||||
"axios-mock-adapter": "^1.21.1",
|
||||
|
@ -187,6 +189,9 @@
|
|||
"typescript": "^4.4.4",
|
||||
"util": "^0.12.4",
|
||||
"uuid": "^9.0.0",
|
||||
"vite": "^4.0.4",
|
||||
"vite-plugin-html": "^3.2.0",
|
||||
"vite-plugin-require": "^1.1.10",
|
||||
"webpack": "^5.72.1",
|
||||
"webpack-assets-manifest": "^5.1.0",
|
||||
"webpack-bundle-analyzer": "^4.5.0",
|
||||
|
|
|
@ -0,0 +1,32 @@
|
|||
import path from 'path';
|
||||
|
||||
import react from '@vitejs/plugin-react';
|
||||
import { defineConfig } from 'vite';
|
||||
import { createHtmlPlugin } from 'vite-plugin-html';
|
||||
import vitePluginRequire from 'vite-plugin-require';
|
||||
|
||||
export default defineConfig({
|
||||
root: 'app',
|
||||
build: {
|
||||
// Relative to the root
|
||||
outDir: '../static',
|
||||
},
|
||||
plugins: [
|
||||
createHtmlPlugin({
|
||||
template: 'index.html',
|
||||
}),
|
||||
react({
|
||||
// Use React plugin in all *.jsx and *.tsx files
|
||||
include: '**/*.{jsx,tsx}',
|
||||
}),
|
||||
// @ts-ignore
|
||||
vitePluginRequire.default(),
|
||||
],
|
||||
resolve: {
|
||||
alias: [
|
||||
{ find: 'soapbox', replacement: path.resolve(__dirname, 'app', 'soapbox') },
|
||||
{ find: 'assets', replacement: path.resolve(__dirname, 'app', 'assets') },
|
||||
],
|
||||
},
|
||||
assetsInclude: ['**/*.oga'],
|
||||
});
|
Ładowanie…
Reference in New Issue