jaredpalmer / tsdx

Zero-config CLI for TypeScript package development
https://tsdx.io
MIT License
11.29k stars 507 forks source link

How to set subdirectory in dist with rollup-plugin-static-files #1143

Open valenciaHQ opened 2 years ago

valenciaHQ commented 2 years ago

Hi! I have this structure:

dist
node_modules
src
    templates
    index.ts

Templates folder as some HTML files that I need and are being accessed as:

const filePath = path.join(__dirname, /templates/${type}.html); and this is all being bundled as one root directory at dist. Does anyone know how to tell to rollup to bundle them as dist/templates/somehtmlfile.html?

Since when I'm running test locally, they run fine since they get the file from /templates, but when I consume the module /templates does not exist.