Skip to content

Commit 022daa7

Browse files
committed
fix: issue with entries in server script
1 parent 0d6b177 commit 022daa7

File tree

2 files changed

+9
-13
lines changed

2 files changed

+9
-13
lines changed

packages/scripts/src/config/CreateWebpackConfig.ts

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,12 @@ export class CreateWebpackConfig {
3434
* @param projectConfig Project configuration as recovered from user directory.
3535
* @param serverConfig Server configuration as recovered from user directory.
3636
* @param isDev Whether this is development mode.
37-
* @param entries Whether to select specified entries from project
3837
*/
3938
constructor(
4039
projectConfig: ProjectConfig,
4140
serverConfig: ServerConfig,
4241
cwd: string,
43-
isDev: boolean = true,
44-
entries?: number[]
42+
isDev: boolean = true
4543
) {
4644
// Create final configuration
4745
// By doing a shallow override
@@ -56,13 +54,6 @@ export class CreateWebpackConfig {
5654
this.cwd = cwd;
5755
this.isDev = isDev;
5856

59-
// filter project if needed
60-
if (entries && entries.length) {
61-
this.projectConfig.files = this.projectConfig.files.filter((f, index) =>
62-
entries.includes(index)
63-
);
64-
}
65-
6657
// Also figure out the publicPath beforehand, because we do need it
6758
const { slug, outputPath, type } = this.projectConfig;
6859
// The public is generated automatically considering

packages/scripts/src/scripts/Server.ts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,13 @@ export class Server {
103103
callbacks: Callbacks,
104104
entries?: number[]
105105
) {
106-
this.projectConfig = projectConfig;
106+
this.projectConfig = { ...projectConfig };
107+
// filter project if needed
108+
if (entries && entries.length) {
109+
this.projectConfig.files = this.projectConfig.files.filter((f, index) =>
110+
entries.includes(index)
111+
);
112+
}
107113
this.serverConfig = serverConfig;
108114
this.cwd = cwd;
109115
this.callbacks = callbacks;
@@ -120,8 +126,7 @@ export class Server {
120126
this.projectConfig,
121127
this.serverConfig,
122128
this.cwd,
123-
true,
124-
entries
129+
true
125130
);
126131
// Check if project has typescript
127132
const [hasTs, tsConfigPath] = hasTypeScript(this.cwd);

0 commit comments

Comments
 (0)