Skip to content

Commit

Permalink
remove redundant entry option
Browse files Browse the repository at this point in the history
  • Loading branch information
Armin Jazi committed May 3, 2024
1 parent b84f539 commit 710f1a6
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 16 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 0 additions & 11 deletions src/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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."
Expand All @@ -52,12 +50,6 @@ export const create = (

return {
name: "ViteWebDockerRemoteFile",
buildStart() {
entryFile = this.emitFile({
type: "chunk",
id: config.entry,
});
},
generateBundle(_, bundle) {
const css: Array<string> = [];
const js: Array<string> = [];
Expand All @@ -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(",");
Expand Down
4 changes: 1 addition & 3 deletions vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 }) => {
Expand All @@ -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",
Expand All @@ -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",
Expand All @@ -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"],
},
Expand Down

0 comments on commit 710f1a6

Please sign in to comment.