Skip to content

Commit

Permalink
feat: NODEPACK_ENTRIES
Browse files Browse the repository at this point in the history
  • Loading branch information
Guillaume Chau committed Aug 12, 2019
1 parent 2f147b8 commit 7b5abcb
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions packages/@nodepack/service/src/config/base.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,23 @@ module.exports = (api, options) => {
config: path.resolve(__dirname, '../runtime/config.js'),
app: api.resolve(options.entry || 'index.js'),
}
let includedEntries = null
if (process.env.NODEPACK_ENTRIES) {
includedEntries = process.env.NODEPACK_ENTRIES.replace(/\s/g, '').split(',')
}
for (const key in entries) {
if (!includedEntries || includedEntries.includes(key)) {
const entry = config.entry(key)
if (options.productionSourceMap || process.env.NODE_ENV !== 'production') {
entry.add(path.resolve(__dirname, '../runtime/sourcemap.js'))
}
entry.add(path.resolve(__dirname, '../runtime/paths.js'))
if (key !== 'config') {
entry.add(path.resolve(__dirname, '../runtime/context.js'))
}
entry.add(entries[key])
}
}

// Configure node polyfills
config.node
Expand Down

0 comments on commit 7b5abcb

Please sign in to comment.