I have a large ts data file:
data.ts
:
export data = [
... // huge data
]
the lib.ts
just use some of the data
:
import { data } from './data.ts';
const fitteredData = data.splice(0,2) // only use some of them
export { fitteredData };
I use fitteredData
in my vue component:
<script setup lang="ts">
import { fitteredData } from "./lib";
</script>
<template>
<div>{{ fitteredData }}</div>
</template>
After run pnpm build
, I find all of the data in data.ts
are builded in final file. How to make the final file only with the fitteredData
?
How to make the final file only with the fitteredData
, to make the final builded files smaller.