Skip to content

Commit e03bd4c

Browse files
author
Guillaume Chau
committed
feat(service): always mark @nodepack/module as external
1 parent 18addf7 commit e03bd4c

File tree

1 file changed

+7
-5
lines changed
  • packages/@nodepack/service/src/config

1 file changed

+7
-5
lines changed

packages/@nodepack/service/src/config/base.js

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,23 +45,25 @@ module.exports = (api, options) => {
4545
.set('exprContextCritical', options.externals)
4646

4747
// External modules (default are modules in package.json deps)
48-
if (options.externals) {
48+
if (options.externals !== false) {
4949
if (options.externals === true) {
5050
const nodeExternals = require('webpack-node-externals')
5151
config.externals(nodeExternals({
52-
whitelist: options.nodeExternalsWhitelist || [
52+
whitelist: (options.nodeExternalsWhitelist || [
5353
/\.(eot|woff|woff2|ttf|otf)$/,
5454
/\.(svg|png|jpg|jpeg|gif|ico|webm)$/,
5555
/\.(mp4|mp3|ogg|swf|webp)$/,
5656
/\.(css|scss|sass|less|styl)$/,
57-
],
57+
]).concat(['@nodepack/module']),
5858
modulesFromFile: true,
5959
}))
6060
} else if (Array.isArray(options.externals)) {
61-
config.externals(options.externals)
61+
config.externals(options.externals.concat(['@nodepack/module']))
6262
} else {
63-
config.externals([options.externals])
63+
config.externals([options.externals, '@nodepack/module'])
6464
}
65+
} else {
66+
config.externals(['@nodepack/module'])
6567
}
6668

6769
// Plugins

0 commit comments

Comments
 (0)