From 710f1a65a72e786f1a6a8dc3a1818de7a9778729 Mon Sep 17 00:00:00 2001 From: Armin Jazi Date: Fri, 3 May 2024 16:34:46 +0200 Subject: [PATCH] remove redundant entry option --- package-lock.json | 4 ++-- src/plugin.ts | 11 ----------- vite.config.ts | 4 +--- 3 files changed, 3 insertions(+), 16 deletions(-) diff --git a/package-lock.json b/package-lock.json index 7fa9cb8..81d1ff5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@openreplyde/web-docker-vite-plugin", - "version": "2.0.0", + "version": "1.0.0-alpha.1", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@openreplyde/web-docker-vite-plugin", - "version": "2.0.0", + "version": "1.0.0-alpha.1", "devDependencies": { "@vitejs/plugin-vue": "^4.0.0", "@vue/eslint-config-prettier": "^7.0.0", diff --git a/src/plugin.ts b/src/plugin.ts index b5e3239..a704a16 100644 --- a/src/plugin.ts +++ b/src/plugin.ts @@ -27,10 +27,8 @@ export const create = ( config: { fileName: string; basePath: string; - entry: string; } & ModuleConfig ): Plugin => { - let entryFile: string; if (!config.basePath) throw new Error( "web docker: basePath is required. This prepends the script and css paths in remote config files." @@ -52,12 +50,6 @@ export const create = ( return { name: "ViteWebDockerRemoteFile", - buildStart() { - entryFile = this.emitFile({ - type: "chunk", - id: config.entry, - }); - }, generateBundle(_, bundle) { const css: Array = []; const js: Array = []; @@ -84,9 +76,6 @@ export const create = ( : ""; const jsString = () => { - if (entryFile) { - js.push(this.getFileName(entryFile)); - } return js .map((file) => getJsAsset(config.basePath.concat(file))) .join(","); diff --git a/vite.config.ts b/vite.config.ts index 1009270..fc550e5 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -2,7 +2,6 @@ import vue from "@vitejs/plugin-vue"; import { defineConfig, loadEnv } from "vite"; import { create } from "./src/plugin"; -import * as path from "path"; /** @type {import('vite').UserConfig} */ export default defineConfig(({ mode }) => { @@ -13,7 +12,6 @@ export default defineConfig(({ mode }) => { plugins: [ vue(), create({ - entry: path.resolve(__dirname, "./src/test-main.ts"), selector: "observed-module", basePath: base, fileName: "remote-config-test-observed-module.json", @@ -22,7 +20,6 @@ export default defineConfig(({ mode }) => { }), create( { - entry: path.resolve(__dirname, "./src/test-main.ts"), basePath: base, pages: [".*"], fileName: "remote-config-test-page-module.json", @@ -35,6 +32,7 @@ export default defineConfig(({ mode }) => { rollupOptions: { output: { manualChunks: { + "test-main": ["./src/test-main"], "test-file": ["./src/test-file"], "test-file-second": ["./src/test-file-2"], },