123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778 |
- import { defineConfig } from "rollup";
- import { terser } from "rollup-plugin-terser";
- import resolve from "rollup-plugin-node-resolve";
- import progress from "rollup-plugin-progress";
- import commonjs from "@rollup/plugin-commonjs";
- import copy from "rollup-plugin-copy";
- import deletePlugin from "rollup-plugin-delete";
- import OMT from "@surma/rollup-plugin-off-main-thread";
- import url from "@rollup/plugin-url";
- export default defineConfig({
- external: [".npmrc", "package.json"],
- input: ["./src/omnimatrix-video-player.js"],
- output: [
- {
- dir: "./example/html-example/lib/omnimatrix-video-player",
- format: "esm",
- entryFileNames: (chunkInfo) => {
- if (/^omnimatrix-video-player/i.test(chunkInfo.name)) {
- return "[name].js";
- } else {
- return "lib/[hash].js";
- }
- },
- chunkFileNames: "lib/[hash].js",
- plugins: [terser()],
- },
- // {
- // dir: "dist/min",
- // format: "es",
- // entryFileNames: (chunkInfo) => {
- // if (/^omnimatrix-video-player/i.test(chunkInfo.name)) {
- // return "[name].min.js";
- // } else {
- // return "lib/[hash].js";
- // }
- // },
- // chunkFileNames: "lib/[hash].js",
- // plugins: [terser()],
- // },
- ],
- plugins: [
- deletePlugin({
- targets: ["./example/html-example/lib/omnimatrix-video-player"],
- }),
- progress(),
- resolve(),
- commonjs(),
- url(),
- copy({
- targets: [
- {
- src: "src/core",
- dest: "./example/html-example/lib/omnimatrix-video-player/lib",
- },
- {
- src: "src/ffmpeg",
- dest: "./example/html-example/lib/omnimatrix-video-player/lib",
- },
- {
- src: "src/.npmrc",
- dest: "./example/html-example/lib/omnimatrix-video-player",
- },
- {
- src: "src/package.json",
- dest: "./example/html-example/lib/omnimatrix-video-player",
- },
- {
- src: "src/README.md",
- dest: "./example/html-example/lib/omnimatrix-video-player",
- },
- // { src: "src/core", dest: "dist/min/lib" },
- // { src: "src/ffmpeg", dest: "dist/min/lib" },
- ],
- }),
- OMT({}),
- ],
- });
|