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

Added support for outDir in Fable compiler #2175

Merged
merged 1 commit into from
Sep 25, 2020

Conversation

ncave
Copy link
Collaborator

@ncave ncave commented Sep 25, 2020

  • Added support for --outDir in Fable compiler.

@alfonsogarciacaro alfonsogarciacaro merged commit d57cbb4 into fable-compiler:nagareyama Sep 25, 2020
@alfonsogarciacaro
Copy link
Member

image

@ncave ncave deleted the next1 branch September 25, 2020 11:09
@alfonsogarciacaro
Copy link
Member

I just noticed this is not copying JS files (not translated from F#) to outDir as fable-splitter used to do, not sure if it's much of an issue.

@ncave
Copy link
Collaborator Author

ncave commented Sep 28, 2020

@alfonsogarciacaro Yes, intentionally. Technically it can be easily done by modifying the code here and copying the (non-F#) import to the target location, something like that:

    let targetRelPath = getTargetRelPath importPath targetDir projDir outDir
    if not (importPath.EndsWith(".fs.js")) then
        <copy file from importPath to outDir + targetRelPath>
    targetRelPath

But the problem is, we're not rewriting the (non-F#) import's own imports, so that's not going to work properly.

Instead, if we need to walk all (non-F#) imports and export them to output, the easiest solution is to simply run TypeScript or a bundler (rollup/webpack) on the Fable output.

@alfonsogarciacaro
Copy link
Member

Ah, true. Makes total sense, thanks for the explanation!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants