Skip to content

Commit

Permalink
Merge pull request #42 from sevenwestmedia/feature/addition-entry-points
Browse files Browse the repository at this point in the history
Add support for additional client entries
  • Loading branch information
JakeGinnivan authored Jan 9, 2020
2 parents 7517d81 + 7551d9c commit 8f2adc1
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ build-stats.csv
*.tgz
test-dist

tsconfig.tsbuildinfo
*.tsbuildinfo

#cache-loader & validation inside this folder
.build-cache
1 change: 1 addition & 0 deletions examples/simple-ssr/client/extra.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
console.log('extra entry!')
3 changes: 3 additions & 0 deletions examples/simple-ssr/config/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,8 @@
module.exports = {
default: {
TS_CONFIG_SERVER: 'examples/simple-ssr/tsconfig.server.json',
ADDITIONAL_CIENT_ENTRIES: {
additional: 'examples/simple-ssr/client/extra.tsx',
},
},
}
4 changes: 4 additions & 0 deletions lib/config/webpack.client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,10 @@ const clientBaseConfig: CreateWebpackConfig = options => {
main: mainEntry,
}

if (options.buildConfig.ADDITIONAL_CIENT_ENTRIES) {
Object.assign(entry, options.buildConfig.ADDITIONAL_CIENT_ENTRIES)
}

const plugins = getPlugins(options.buildConfig)
const resolvePlugins: webpack.ResolvePlugin[] = []

Expand Down
4 changes: 4 additions & 0 deletions lib/runtime/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@ export interface BuildConfig {
/** entry file for the client */
CLIENT_ENTRY: string

ADDITIONAL_CIENT_ENTRIES?: {
[name: string]: string[]
}

/** file for client polyfills if needed */
CLIENT_POLYFILLS: string | false

Expand Down

0 comments on commit 8f2adc1

Please sign in to comment.