rollup-dependency-tree
Advanced tools
Comparing version 0.0.10 to 0.0.11
@@ -24,6 +24,6 @@ "use strict"; | ||
function dependenciesForTrees(result, visited, chunkToResolve, allChunks, dynamicImport, opts) { | ||
visited.add(chunkToResolve); | ||
if (opts && opts.walk && !opts.walk({ chunk: chunkToResolve, dynamicImport: dynamicImport })) { | ||
return; | ||
} | ||
visited.add(chunkToResolve); | ||
addChunk(chunkToResolve, result, opts, dynamicImport); | ||
@@ -30,0 +30,0 @@ chunkToResolve.imports.concat(chunkToResolve.dynamicImports).forEach(function (fileName) { |
@@ -6,6 +6,7 @@ "use strict"; | ||
var realworld_1 = require("./realworld"); | ||
var index2_1 = require("./index2"); | ||
describe('test suite', function () { | ||
it('dependenciesForTree should handle sveltejs/realworld example', function () { | ||
var rollupData = realworld_1.default; | ||
var entryChunk = rollupData.find(function (c) { return c.facadeModuleId.endsWith('routes/index.svelte'); }); | ||
var entryChunk = rollupData.find(function (c) { return c.facadeModuleId && c.facadeModuleId.endsWith('routes/index.svelte'); }); | ||
var result = index_1.dependenciesForTree(entryChunk, rollupData, { walk: function (ctx) { return !ctx.dynamicImport; } }); | ||
@@ -15,1 +16,9 @@ chai_1.expect(result.size).equal(5); | ||
}); | ||
describe('test suite', function () { | ||
it('dependenciesForTree should handle sapper css index2 test', function () { | ||
var rollupData = index2_1.default; | ||
var entryChunk = rollupData.find(function (c) { return c.facadeModuleId && c.facadeModuleId.endsWith('routes/index2.svelte'); }); | ||
var result = index_1.dependenciesForTree(entryChunk, rollupData, { walk: function (ctx) { return !ctx.dynamicImport; } }); | ||
chai_1.expect(result.size).equal(3); | ||
}); | ||
}); |
@@ -44,6 +44,6 @@ import type { RenderedChunk } from 'rollup'; | ||
visited.add(chunkToResolve); | ||
if (opts && opts.walk && !opts.walk({chunk: chunkToResolve, dynamicImport})) { | ||
return; | ||
} | ||
visited.add(chunkToResolve); | ||
addChunk(chunkToResolve, result, opts, dynamicImport); | ||
@@ -50,0 +50,0 @@ chunkToResolve.imports.concat(chunkToResolve.dynamicImports).forEach(fileName => { |
{ | ||
"name": "rollup-dependency-tree", | ||
"version": "0.0.10", | ||
"version": "0.0.11", | ||
"description": "Builds a dependency tree from a Rollup compilation result", | ||
@@ -16,2 +16,3 @@ "main": "dist/index.js", | ||
"@types/mocha": "^7.0.2", | ||
"@types/node": "^14.6.4", | ||
"chai": "^4.2.0", | ||
@@ -18,0 +19,0 @@ "mocha": "^8.1.2", |
@@ -6,2 +6,3 @@ import { expect } from 'chai'; | ||
import realworld from './realworld'; | ||
import index2 from './index2'; | ||
@@ -11,3 +12,3 @@ describe('test suite', () => { | ||
const rollupData: OutputChunk[] = realworld as unknown as OutputChunk[]; | ||
const entryChunk = rollupData.find(c => c.facadeModuleId.endsWith('routes/index.svelte')); | ||
const entryChunk = rollupData.find(c => c.facadeModuleId && c.facadeModuleId.endsWith('routes/index.svelte')); | ||
const result = dependenciesForTree(entryChunk, rollupData, { walk: ctx => !ctx.dynamicImport }); | ||
@@ -17,1 +18,10 @@ expect(result.size).equal(5); | ||
}); | ||
describe('test suite', () => { | ||
it('dependenciesForTree should handle sapper css index2 test', () => { | ||
const rollupData: OutputChunk[] = index2 as unknown as OutputChunk[]; | ||
const entryChunk = rollupData.find(c => c.facadeModuleId && c.facadeModuleId.endsWith('routes/index2.svelte')); | ||
const result = dependenciesForTree(entryChunk, rollupData, { walk: ctx => !ctx.dynamicImport }); | ||
expect(result.size).equal(3); | ||
}) | ||
}); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
861798
16
5952
8