Giter VIP home page Giter VIP logo

Comments (10)

pedronauck avatar pedronauck commented on May 5, 2024 2

If you want to transpile Typescript on our project just pass a config on your doczrc.js:

// doczrc.js
export default {
  typescript: true
}

So, if you want some custom config do something like we did on docz-plugin-babel6 @mbrn
https://github.com/pedronauck/docz/blob/master/packages/docz-plugin-babel6/src/index.ts

from docz.

FlatMapIO avatar FlatMapIO commented on May 5, 2024 1

Thank you @pedronauck , the problem was solved. 👍

from docz.

pedronauck avatar pedronauck commented on May 5, 2024

Did you put the .tsx extension at import?

import { Something } from './Something.tsx'`

I don't even know why this is mandatory on mdx 😞

from docz.

FlatMapIO avatar FlatMapIO commented on May 5, 2024

Thanks @pedronauck , I tried it and got "Module parse failed: Unexpected token (3:21)
You may need an appropriate loader to handle this file type." message

from docz.

albinekb avatar albinekb commented on May 5, 2024

You need to enable typescript via CLI --typescript or your docz config file.

from docz.

FlatMapIO avatar FlatMapIO commented on May 5, 2024

docz using babel7 compile tsx, It does not support const enum , So i can't use it for now .
Thanks @albinekb .

from docz.

pedronauck avatar pedronauck commented on May 5, 2024

You can modify your bundler config to use ts-loader instead of babel plugin @huodon

export default {
  modifyBundlerConfig: (config) => {
    /* set ts-loader here */
    return config
  }
}

from docz.

cvle avatar cvle commented on May 5, 2024

@huodon How did you use ts-loader instead? I tried and I failed. Mind showing the essential parts of your config?

from docz.

pedronauck avatar pedronauck commented on May 5, 2024

@cvle if you want to use ts-loader you can just docz-plugin-babel6 that implements ts-loader together with babel 6 ✌️

from docz.

mbrn avatar mbrn commented on May 5, 2024

if i want to use ts-loader with options: transpileOnly, how can i implement this to doczrc.js

from docz.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.