@travetto/pack 3.4.0-rc.2 → 3.4.0-rc.4

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@travetto/pack",
3
- "version": "3.4.0-rc.2",
3
+ "version": "3.4.0-rc.4",
4
4
  "description": "Code packing utilities",
5
5
  "keywords": [
6
6
  "travetto",
@@ -65,6 +65,17 @@ export function getFiles(): string[] {
65
65
  .flatMap(getFilesFromModule);
66
66
  }
67
67
 
68
+ export function getIgnoredModules(): string[] {
69
+ const out = [...RootIndex.getModuleList('all')]
70
+ .map(x => RootIndex.manifest.modules[x])
71
+ .filter(m => !m.profiles.includes('std'))
72
+ .map(m => m.name);
73
+
74
+ out.push('@travetto/pack', '@travetto/compiler');
75
+
76
+ return out;
77
+ }
78
+
68
79
  export function getTerserConfig(): Parameters<typeof terser>[0] {
69
80
  return {
70
81
  mangle: true,
@@ -7,15 +7,17 @@ import type { RollupOptions } from 'rollup';
7
7
 
8
8
  import { RootIndex } from '@travetto/manifest';
9
9
 
10
- import { getEntry, getOutput, getTerserConfig, getFiles } from './config';
10
+ import { getEntry, getOutput, getTerserConfig, getFiles, getIgnoredModules } from './config';
11
11
  import { travettoImportPlugin } from './rollup-esm-dynamic-import';
12
12
 
13
- const NEVER_INCLUDE = new Set(['@parcel/watcher']);
13
+ const NEVER_INCLUDE = new Set<string>([]);
14
14
 
15
15
  export default function buildConfig(): RollupOptions {
16
16
  const output = getOutput();
17
17
  const entry = getEntry();
18
18
  const files = getFiles();
19
+ const ignore = getIgnoredModules();
20
+ const ignoreRe = new RegExp(`^(${ignore.join('|')})`);
19
21
 
20
22
  return {
21
23
  input: [entry],
@@ -23,7 +25,7 @@ export default function buildConfig(): RollupOptions {
23
25
  plugins: [
24
26
  jsonImport(),
25
27
  commonjsRequire({
26
- ignore: id => NEVER_INCLUDE.has(id),
28
+ ignore: id => ignoreRe.test(id) || NEVER_INCLUDE.has(id),
27
29
  dynamicRequireRoot: RootIndex.manifest.workspacePath,
28
30
  dynamicRequireTargets: (output.format === 'commonjs' ? files : [])
29
31
  }),