Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change output folder name from "dist" to "build" ? #351

Open
ghost opened this issue Nov 26, 2019 · 11 comments
Open

Change output folder name from "dist" to "build" ? #351

ghost opened this issue Nov 26, 2019 · 11 comments
Labels
kind: feature New feature or request scope: docs Documentation could be improved. Or changes that only affect docs

Comments

@ghost
Copy link

ghost commented Nov 26, 2019

Current Behavior

I can not find any way to override tsdx output to use any other folder than "dist"

Desired Behavior

Would like to be able to specify another output folder such as "build" instead of "dist"

Suggested Solution

--distFolder option.

Who does this impact? Who is this for?

Users that don't want the generated output in their dist folder.

Describe alternatives you've considered

Manually rename/move generated files.

@swyxio
Copy link
Collaborator

swyxio commented Dec 4, 2019

i havent tried this out yet but have you tried setting it in tsconfig.json? what happens when you do that

@arthurdenner
Copy link
Contributor

It seems like the only way possible to do it at the moment is through tsdx.config.js:

module.exports = {
  rollup(config, options) {
    config.output.file = config.output.file.replace('dist', 'build');

    return config;
  },
};

Regarding how opinionated tsdx wants to be, would be better to have it configurable.

@swyxio
Copy link
Collaborator

swyxio commented Dec 4, 2019

yeah. my inclination is to leave this sort of thing inside rollup config. and document it :)

@swyxio swyxio added the scope: docs Documentation could be improved. Or changes that only affect docs label Dec 4, 2019
@arthurdenner
Copy link
Contributor

Would be nice to have some official position about these open requests - not from you specifically, I see that you're more like a community moderator - so that we can create documentation about it (I'd gladly help) but so far we have pending questions only. 😕

@arvigeus

This comment has been minimized.

@agilgur5

This comment has been minimized.

@ambroseus ambroseus mentioned this issue Dec 18, 2019
@agilgur5
Copy link
Collaborator

agilgur5 commented Mar 9, 2020

I'm considering allowing this to be configurable via tsconfig.json's outDir or outFile. Right now both are ignored by TSDX and we should try to make all tsconfig.json work where possible for similar output to tsc and less unexpected unsupported options.

@dkovacevic15
Copy link

dkovacevic15 commented Jul 12, 2020

It seems like the only way possible to do it at the moment is through tsdx.config.js:

module.exports = {
  rollup(config, options) {
    config.output.file = config.output.file.replace('dist', 'build');

    return config;
  },
};

Regarding how opinionated tsdx wants to be, would be better to have it configurable.

This doesn't work anymore, as tsdx outputs an index.js file to the dist directory, irrespective of rollup's output target

@agilgur5
Copy link
Collaborator

agilgur5 commented Jul 26, 2020

This doesn't work anymore, as tsdx outputs an index.js file to the dist directory, irrespective of rollup's output target

Good point. It may not have ever worked, that's existed for as long as I know. A post-build script of mv dist/ build/ would accomplish the same thing though and would be less fragile to changes.

@Rain120
Copy link

Rain120 commented Sep 19, 2020

My Result

image

@Ry-DS
Copy link

Ry-DS commented Mar 9, 2021

My Result

snipped

I'm a little confused how the watch/dev script works. We cannot use tsdx start anymore if we are expecting the output to be in a folder other than dist right?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind: feature New feature or request scope: docs Documentation could be improved. Or changes that only affect docs
Projects
None yet
Development

No branches or pull requests

7 participants