Advertisement
Guest User

Untitled

a guest
Oct 15th, 2019
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. In jest.config.json:
  2.  
  3.  
  4. ```json
  5. {
  6. ...
  7.  
  8. "moduleNameMapper": {
  9. "@ts(.*)$": "<rootDir>/resources/ts/$1"
  10. }
  11. }
  12. ```
  13.  
  14. In tsconfig.json:
  15.  
  16. ```json
  17. {
  18. "compilerOptions": {
  19. ...
  20.  
  21. "baseUrl": ".",
  22. "paths": {
  23. "@ts/*": ["resources/ts/*"]
  24. }
  25. }
  26.  
  27. ...
  28. }
  29. ```
  30.  
  31.  
  32. in webpack.mix.js:
  33.  
  34. ```javascript
  35. const mix = require('laravel-mix');
  36.  
  37. ...
  38.  
  39. mix.webpackConfig({
  40. resolve: {
  41. alias: {
  42. "@ts": path.resolve(
  43. __dirname,
  44. "resources/ts"
  45. )
  46. }
  47. }
  48. });
  49. ```
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement