forked from joypixels/emojify.js
-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathvite.config.node.mts
More file actions
37 lines (36 loc) · 1.08 KB
/
vite.config.node.mts
File metadata and controls
37 lines (36 loc) · 1.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
import { defineConfig } from "vite";
import banner from "vite-plugin-banner";
import pkg from "./package.json";
import { replaceEmojiListPlugin } from "./vite-plugins.mjs";
export default defineConfig({
// We set the root to our source folder.
root: "./src",
build: {
// We output bundled JS into dist/js (mimicking your gulp dest)
outDir: "../dist/js",
// We disable emptying the outDir because our plugins create files in other parts of "dist"
emptyOutDir: false,
rollupOptions: {
input: "./src/index.ts",
output: {
// Append ".min" suffix to the generated JS file.
entryFileNames: "[name].min.js",
},
},
ssr: true,
minify: "esbuild",
lib: {
entry: ["./src/index.ts"],
name: "emojify",
formats: ["umd"],
},
},
plugins: [
// Replace the placeholder token with the actual comma–separated emoji list.
replaceEmojiListPlugin(),
// Add a banner header (license) to the JS bundle.
banner(`/*! ${pkg.name} - v${pkg.version} -
* Copyright (c) HackMD ${new Date().getFullYear()}
*/`),
],
});