pkgbld 1.22.0 → 1.22.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.js +6 -2
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -37,6 +37,7 @@ function CommaSeparatedStringOrBoolean(value) {
37
37
  if (typeof value === 'boolean') {
38
38
  return value;
39
39
  }
40
+ // TODO check how we get array here
40
41
  if (Array.isArray(value) && value.length === 0) {
41
42
  return true;
42
43
  }
@@ -269,7 +270,7 @@ async function externals (provider, config, inputs) {
269
270
  const allowGenericUmd = config.umdInputs.length === 1 && inputs.length === 1;
270
271
  if (config.formats.length > 0) {
271
272
  const format = (allowGenericUmd ? undefined : config.formats.filter(format => format !== 'umd'));
272
- provider.provide(() => pluginExternals({
273
+ provider.provide(() => pluginExternals(config.includeExternals === false ? {} : {
273
274
  external: (id, external, importer) => includeExternals(importer, external, id, config)
274
275
  }), 2000 /* Priority.externals */, { format });
275
276
  // for eject config
@@ -749,7 +750,7 @@ async function writeJson(path, json) {
749
750
  await fs.writeFile(path, toFormattedJson(json));
750
751
  }
751
752
 
752
- var version = "1.22.0";
753
+ var version = "1.22.1";
753
754
  var name = "pkgbld";
754
755
  var license = "MIT";
755
756
  var author = "Konstantin Shutkin";
@@ -875,8 +876,11 @@ async function ejectConfig(config, pkgPath, options, inputs, helpers, pkg) {
875
876
  if (options.formats.includes('umd')) {
876
877
  imports.set('path', 'path');
877
878
  imports.set('lodash/camelCase.js', 'camelCase');
879
+ imports.set('url', 'url'); // for __dirname polyfill
878
880
  setup.add(`const pkgName = ${generate(pkgName)}`);
879
881
  setup.add(helpers.getGlobalName.toString());
882
+ // polyfill __dirname
883
+ setup.add('const __dirname = url.fileURLToPath(new URL(\'.\', import.meta.url));');
880
884
  }
881
885
  // imports
882
886
  const importsString = Array.from(imports)
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.22.0",
2
+ "version": "1.22.1",
3
3
  "name": "pkgbld",
4
4
  "license": "MIT",
5
5
  "author": "Konstantin Shutkin",