Code Monkey home page Code Monkey logo

Comments (5)

Quramy avatar Quramy commented on May 22, 2024

Hi eesdil.

Tsuquyomi does not support compilation on save.

If you want to compile your sources immediately, you can use tsc --watch or gulp-typescript.

from tsuquyomi.

icholy avatar icholy commented on May 22, 2024

You can also use autocmd:

autocmd BufWritePost *.ts !tsc

from tsuquyomi.

eesdil avatar eesdil commented on May 22, 2024

Hi. Yes, that's true, but it compiles everything related files also and it is slow. All files from the references. And It is crashing my grunt server too, I suppose we because of too much file changed... tsc --watch is also compiling everything..
I am Using grunt-typescript, but currently it is also slow (fast compile), however able to compile one file only, but it is crashing grunt somehow (connect) too.

For atom, they made a nice plug-in it is very fast and also compiles only one file on save. So I was thinking if we already have a tsc server it could compile the file...

from tsuquyomi.

icholy avatar icholy commented on May 22, 2024

I'm using gulp-typescript which has built in support for incremental compilation.

from tsuquyomi.

jon49 avatar jon49 commented on May 22, 2024

I did it this way:

function! CompileTypeScriptFile()
    let filename=expand('%:p')
    silent execute "!cd ../js && npm run typescript -- " . filename
endfunction
set ballooneval
augroup typeScriptGroup
    autocmd!
    " autocmd FileType typescript setlocal completeopt+=menu,preview balloonexpr=tsuquyomi#balloonexpr()
    " autocmd FileType typescript inoremap <buffer> .. .<C-x><C-o>
    autocmd BufWritePost *.ts :call CompileTypeScriptFile()
augroup END

Where my file structure is like so:

- project
  - ts
  - js

And I have the npm (in package.json) code like so:

{
  "scripts": {
   "typescript": "cd ../ts && tsc --isolatedModules -m commonjs -t es5 --removeComments --sourceMap --outDir ../js --rootDir ts "
  }
}

from tsuquyomi.

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.