Skip to content

Commit

Permalink
test: ✅ add test case for use some source twice
Browse files Browse the repository at this point in the history
  • Loading branch information
stormslowly committed Dec 27, 2023
1 parent ffcdfb5 commit 020e2dc
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
const assert = require('assert');
const { parseBuildResult } = require('../../../scripts/test-utils');
const { files } = parseBuildResult(__dirname);

const content = files['index.js'];

assert(
content.includes('src/dep/index.js'),
`dep/index.js should keep in chunk`,
);
assert(content.includes('src/dep/dep.js'), `dep/dep.js should keep in chunk`);
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"optimizePackageImports": false
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export const x = 'x';
export const y = 'y';
export const z = 'z';
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export * from './dep.js';
export const a = 'a';
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import { a, x } from './dep';
import { y } from './dep';

console.log(a, x, y);

0 comments on commit 020e2dc

Please sign in to comment.