1

I have a project that uses laravel 5.2 here I use laravel elixir for javascript pre-processors and I find that the typescript is easier to use because it is object-oriented and can also be compiled into Javascript, the question is can I combine Javascript and typescript using laravel Elixir? is there a library that can do that?

mix.script(['jquery.js', 'app.ts'], 'all.js']);

Thanks :)

1

1 Answer 1

2

Since it doesn't support TypeScript out of the box : https://laravel.com/docs/5.2/elixir#babel recommend just running tsc -w -p ./example/tsconfig.json and using the .js output as it is in mix.script.

You can even use concurrently to run both tsc -w with other tasks : https://www.npmjs.com/package/concurrently

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.