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