Skip to content

Commit

Permalink
chore: remove unnecessary treeshaking code
Browse files Browse the repository at this point in the history
  • Loading branch information
eiinu committed Nov 13, 2023
1 parent 03ff434 commit 618432a
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions scripts/generate-unplugin-deps.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,12 @@ config.nav.forEach((item) => {
if (element.exclude != true) {
let outputMjs = '';
if (element.type == 'methods' && target == 'nutui') {
outputMjs = `import _${element.name} from '../_es/${element.name}.js';
outputMjs = `import ${element.name} from '../_es/${element.name}.js';
import { show${element.name} } from '../_es/${element.name}.js';
const treeshaking = (t) => t;
const ${element.name} = treeshaking(_${element.name});
export { ${element.name}, show${element.name} };`;
export { ${element.name}, show${element.name}, ${element.name} as default };`;
} else {
outputMjs = `import _${element.name} from '../_es/${element.name}.js';
const treeshaking = (t) => t;
const ${element.name} = treeshaking(_${element.name});
export { ${element.name} };`;
outputMjs = `import ${element.name} from '../_es/${element.name}.js';
export { ${element.name}, ${element.name} as default };`;
}
tasks.push(
fs.outputFile(path.resolve(__dirname, `../dist/packages/${element.name}/index.mjs`), outputMjs, 'utf8', () => {
Expand Down

0 comments on commit 618432a

Please sign in to comment.