mirror of
https://github.com/mastodon/mastodon.git
synced 2025-05-11 20:21:10 +00:00
fixes for testing
This commit is contained in:
parent
ba41556bfc
commit
6ac26c81f4
4
.gitignore
vendored
4
.gitignore
vendored
|
@ -21,6 +21,7 @@
|
|||
/public/system
|
||||
/public/assets
|
||||
/public/packs
|
||||
/public/packs-dev
|
||||
/public/packs-test
|
||||
.env
|
||||
.env.production
|
||||
|
@ -74,6 +75,3 @@ docker-compose.override.yml
|
|||
|
||||
# Ignore local-only rspec configuration
|
||||
.rspec-local
|
||||
|
||||
# Vite Ruby output
|
||||
/public/vite*
|
||||
|
|
|
@ -272,7 +272,7 @@ async function mountReactComponent(element: Element) {
|
|||
);
|
||||
|
||||
const { default: Component } = (await import(
|
||||
`@/mastodon/components/admin/${componentName}`
|
||||
`@/mastodon/components/admin/${componentName}.jsx`
|
||||
)) as { default: React.ComponentType };
|
||||
|
||||
const root = createRoot(element);
|
||||
|
|
|
@ -3,8 +3,6 @@ import { loadLocale } from 'mastodon/locales';
|
|||
import main from 'mastodon/main';
|
||||
import { loadPolyfills } from 'mastodon/polyfills';
|
||||
|
||||
import '@/styles/application.scss';
|
||||
|
||||
start();
|
||||
|
||||
loadPolyfills()
|
||||
|
|
|
@ -1 +0,0 @@
|
|||
import '../styles/mailer.scss';
|
|
@ -28,7 +28,7 @@ function main() {
|
|||
if (isProduction() && me && 'serviceWorker' in navigator) {
|
||||
const { Workbox } = await import('workbox-window');
|
||||
const wb = new Workbox(
|
||||
isDevelopment() ? '/vite-dev/dev-sw.js?dev-sw' : '/sw.js',
|
||||
isDevelopment() ? '/packs-dev/dev-sw.js?dev-sw' : '/sw.js',
|
||||
{ type: 'module', scope: '/' },
|
||||
);
|
||||
let registration;
|
||||
|
|
|
@ -9,12 +9,12 @@
|
|||
},
|
||||
"development": {
|
||||
"autoBuild": true,
|
||||
"publicOutputDir": "vite-dev",
|
||||
"publicOutputDir": "packs-dev",
|
||||
"port": 3036
|
||||
},
|
||||
"test": {
|
||||
"autoBuild": true,
|
||||
"publicOutputDir": "vite-test",
|
||||
"publicOutputDir": "packs-test",
|
||||
"port": 3037
|
||||
}
|
||||
}
|
||||
|
|
|
@ -24,7 +24,7 @@ import { MastodonServiceWorkerLocales } from './config/vite/plugin-sw-locales';
|
|||
const jsRoot = path.resolve(__dirname, 'app/javascript');
|
||||
const entrypointRoot = path.resolve(jsRoot, 'entrypoints');
|
||||
|
||||
const config: UserConfigFnPromise = async ({ mode }) => {
|
||||
const config: UserConfigFnPromise = async ({ mode, command }) => {
|
||||
const entrypointFiles = await fs.readdir(entrypointRoot);
|
||||
const entrypoints: Record<string, string> = entrypointFiles.reduce(
|
||||
(acc, file) => {
|
||||
|
@ -69,6 +69,7 @@ const config: UserConfigFnPromise = async ({ mode }) => {
|
|||
outDir: path.resolve(__dirname, '.dist'),
|
||||
emptyOutDir: true,
|
||||
manifest: 'manifest.json',
|
||||
sourcemap: true,
|
||||
rollupOptions: {
|
||||
input: entrypoints,
|
||||
output: {
|
||||
|
@ -110,7 +111,9 @@ const config: UserConfigFnPromise = async ({ mode }) => {
|
|||
},
|
||||
},
|
||||
plugins: [
|
||||
RailsPlugin(),
|
||||
RailsPlugin({
|
||||
compress: mode !== 'production' && command === 'build',
|
||||
}),
|
||||
react(),
|
||||
MastodonServiceWorkerLocales(),
|
||||
VitePWA({
|
||||
|
|
Loading…
Reference in New Issue
Block a user