Graphical overhaul.
Remove all legacy pixeldrain pages, handlers and assets. Remove old theming engine. Make logo responsive to the accent colour. Lots of other stuff.
This commit is contained in:
@@ -1,68 +1,47 @@
|
||||
import { defineConfig } from 'vite';
|
||||
import { svelte } from '@sveltejs/vite-plugin-svelte';
|
||||
import { sveltePreprocess } from 'svelte-preprocess';
|
||||
|
||||
import { svelte, vitePreprocess } from '@sveltejs/vite-plugin-svelte';
|
||||
import resolve from '@rollup/plugin-node-resolve';
|
||||
import commonjs from '@rollup/plugin-commonjs';
|
||||
import livereload from 'rollup-plugin-livereload';
|
||||
import terser from '@rollup/plugin-terser';
|
||||
import babel from '@rollup/plugin-babel'
|
||||
import typescript from '@rollup/plugin-typescript'
|
||||
|
||||
const production = process.env.NODE_ENV === "production"
|
||||
console.log("Production mode:", production)
|
||||
|
||||
const builddir = "../res/static/svelte"
|
||||
const name = "wrap"
|
||||
|
||||
export default defineConfig({
|
||||
mode: production ? "production" : "development",
|
||||
// Chunks are loaded relative to the script which imports them
|
||||
base: "./",
|
||||
build: {
|
||||
outDir: builddir,
|
||||
emptyOutDir: true,
|
||||
minify: production,
|
||||
sourcemap: !production,
|
||||
lib: {
|
||||
entry: "src/wrap.js",
|
||||
name: "nova_web",
|
||||
fileName: name,
|
||||
}
|
||||
// Compile newer syntax down to what browsers from September 2021 support
|
||||
target: ["chrome94", "edge94", "firefox91", "safari15"],
|
||||
rollupOptions: {
|
||||
input: "src/wrap.js",
|
||||
// The entrypoint keeps its name so the HTML template can find it,
|
||||
// the chunks it imports get a hash in their names
|
||||
output: { entryFileNames: "wrap.js" },
|
||||
},
|
||||
},
|
||||
plugins: [
|
||||
svelte({
|
||||
preprocess: sveltePreprocess(),
|
||||
compilerOptions: {},
|
||||
emitCss: false,
|
||||
}),
|
||||
// Svelte can't strip TypeScript enums by itself
|
||||
svelte({ preprocess: vitePreprocess({ script: true }), emitCss: false }),
|
||||
|
||||
|
||||
babel({
|
||||
extensions: [".js", ".ts", ".svelte"],
|
||||
babelHelpers: "bundled",
|
||||
}),
|
||||
|
||||
// If you have external dependencies installed from npm, you'll most
|
||||
// likely need these plugins. In some cases you'll need additional
|
||||
// configuration - consult the documentation for details:
|
||||
// https://github.com/rollup/plugins/tree/master/packages/commonjs
|
||||
// Resolves imports relative to the src directory, like "lib/NovaAPI"
|
||||
resolve({
|
||||
browser: true,
|
||||
exportConditions: ['svelte'],
|
||||
modulePaths: [process.cwd() + "/src", process.cwd() + "/node_modules"],
|
||||
extensions: [".svelte", ".mjs", ".js", ".json", ".mts", ".ts"],
|
||||
}),
|
||||
commonjs(),
|
||||
typescript(),
|
||||
|
||||
// Watch the `public` directory and refresh the browser on changes when
|
||||
// not in production
|
||||
// Refresh the browser when the build changes
|
||||
!production && livereload({
|
||||
watch: `${builddir}/${name}.*`,
|
||||
watch: builddir,
|
||||
port: 5000,
|
||||
}),
|
||||
|
||||
// If we're building for production (npm run build instead of npm run
|
||||
// dev), minify
|
||||
production && terser(),
|
||||
]
|
||||
],
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user