<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: dotorimook</title>
    <description>The latest articles on DEV Community by dotorimook (@dotorimook).</description>
    <link>https://dev.to/dotorimook</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F178820%2F27eb9068-c416-44b9-8d7d-8d30ec6ea8ff.png</url>
      <title>DEV Community: dotorimook</title>
      <link>https://dev.to/dotorimook</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/dotorimook"/>
    <language>en</language>
    <item>
      <title>What is wrong with `export` and `export default`?</title>
      <dc:creator>dotorimook</dc:creator>
      <pubDate>Fri, 03 Jul 2020 04:11:13 +0000</pubDate>
      <link>https://dev.to/dotorimook/what-is-wrong-with-export-and-export-default-28g2</link>
      <guid>https://dev.to/dotorimook/what-is-wrong-with-export-and-export-default-28g2</guid>
      <description>&lt;p&gt;I have been using &lt;code&gt;export&lt;/code&gt; and &lt;code&gt;export default&lt;/code&gt; together, and there is no much difference in the usage but aliasing to import the module. In fact, I was thinking that they are just same when I import them.&lt;br&gt;
However, I found there is a difference between &lt;code&gt;export&lt;/code&gt; and &lt;code&gt;export default&lt;/code&gt;. Let me show an simple example.&lt;/p&gt;
&lt;h3&gt;
  
  
  TestModule.js
&lt;/h3&gt;


&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;let a = 0;

const test = () =&amp;gt; a++;

export {a, test};
export default ({a, test});
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;h3&gt;
  
  
  index.js
&lt;/h3&gt;


&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import module, { a, test } from './TestModule';

const check = () =&amp;gt; console.log(a, module.a);

check();
module.test();
check();
module.test();
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;I expected that the console would be like this because index.js import just same reference:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;0 0
1 1
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;BUT&lt;/strong&gt;, the what the console really says is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;0 0
1 0
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;I think the references of theme are different each other, but I don't understand why? Is there some one explain about why, please let me know.&lt;/p&gt;

&lt;p&gt;Anyway, I think I have to use them becarefuly.&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>export</category>
      <category>import</category>
      <category>module</category>
    </item>
    <item>
      <title>Important to know for Ionic AppFlow's Live Update</title>
      <dc:creator>dotorimook</dc:creator>
      <pubDate>Thu, 25 Jun 2020 01:25:49 +0000</pubDate>
      <link>https://dev.to/dotorimook/important-to-know-for-ionic-appflow-s-live-update-28hc</link>
      <guid>https://dev.to/dotorimook/important-to-know-for-ionic-appflow-s-live-update-28hc</guid>
      <description>&lt;p&gt;When you decided to develop a hybrid app, it could be the one of the advantages of hybrid app that you can update the app right away without updating through App Store or Play Store.&lt;br&gt;
I investigated the live update feature of Ionic AppFlow, and the AppFlow service itself is pretty much neat and looking-good and the process of deploying and live-updating looks so much easy. So I chose to use Ionic AppFlow for live updating.&lt;br&gt;
BUT, for almost more than a week, I was in trouble making the live update to work, and the support department in Ionic was not helpful so much. So I decided to write What the problem I met was and share to solve the problem.&lt;/p&gt;

&lt;p&gt;I tried the live update feature from the instruction from appFlow page like following: linking with &lt;code&gt;ionic link ${your_app_id}&lt;/code&gt; and &lt;code&gt;ionic deploy add&lt;/code&gt; to set up Ionic Deploy.&lt;/p&gt;

&lt;p&gt;Then you can meet the following errors.&lt;/p&gt;
&lt;h2&gt;
  
  
  1. Missing values
&lt;/h2&gt;

&lt;p&gt;Then you can see some added text in the &lt;code&gt;android/app/src/main/res/values/strings.xml&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;...
  &amp;lt;string name="ionic_app_id"&amp;gt;${your_app_id}&amp;lt;/string&amp;gt;
  &amp;lt;string name="ionic_channel_name"&amp;gt;Master&amp;lt;/string&amp;gt;
  &amp;lt;string name="ionic_update_method"&amp;gt;auto&amp;lt;/string&amp;gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;If you chaned the channel name and update method, it would be different.&lt;br&gt;
Then if you run the application from Android Studio, you will meet the following error:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;E/m.midas.jobfle: Invalid ID 0x00000000.
E/PluginManager: Uncaught exception from plugin
    android.content.res.Resources$NotFoundException: String resource ID #0x0
        at android.content.res.Resources.getText(Resources.java:363)
        at android.content.res.Resources.getString(Resources.java:456)
        at android.content.Context.getString(Context.java:580)
        at com.ionicframework.common.IonicCordovaCommon.getStringResourceByName(IonicCordovaCommon.java:341)
        at com.ionicframework.common.IonicCordovaCommon.getNativeConfig(IonicCordovaCommon.java:425)
        at com.ionicframework.common.IonicCordovaCommon.getPreferences(IonicCordovaCommon.java:384)
        at com.ionicframework.common.IonicCordovaCommon.execute(IonicCordovaCommon.java:92)
        at org.apache.cordova.CordovaPlugin.execute(CordovaPlugin.java:98)
        at org.apache.cordova.PluginManager.exec(PluginManager.java:132)
        at com.getcapacitor.MessageHandler.callCordovaPluginMethod(MessageHandler.java:69)
        at com.getcapacitor.MessageHandler.postMessage(MessageHandler.java:45)
        at android.os.MessageQueue.nativePollOnce(Native Method)
        at android.os.MessageQueue.next(MessageQueue.java:326)
        at android.os.Looper.loop(Looper.java:181)
        at android.os.HandlerThread.run(HandlerThread.java:65)
E/Capacitor/Console: File: capacitor-runtime.js - Line 2654 - Msg: Uncaught (in promise) String resource ID #0x0
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;You can see the error message related in chrome inspector &lt;code&gt;Uncaught (in promise) String resource ID #0x0&lt;/code&gt;. It means that live update didn't make due to the error.&lt;br&gt;
In the process of loading and live updating the app, it checks some environmental values from &lt;code&gt;strings.xml&lt;/code&gt; or &lt;code&gt;SharedPreference&lt;/code&gt;. However, if there is some missing values, the process will stop and just go to the next step.&lt;br&gt;
I found some missing value keys: &lt;code&gt;ionic_max_versions&lt;/code&gt;, &lt;code&gt;ionic_update_api&lt;/code&gt;, &lt;code&gt;ionic_min_background_duration&lt;/code&gt;.&lt;br&gt;
So, what you have to do is adding some additional values in &lt;code&gt;strings.xml&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;resources&amp;gt;
...
  &amp;lt;string name="ionic_app_id"&amp;gt;${your_app_id}&amp;lt;/string&amp;gt;
  &amp;lt;string name="ionic_channel_name"&amp;gt;Master&amp;lt;/string&amp;gt;
  &amp;lt;string name="ionic_update_method"&amp;gt;auto&amp;lt;/string&amp;gt;
  &amp;lt;string name="ionic_max_versions" &amp;gt;2&amp;lt;/string&amp;gt;
  &amp;lt;string name="ionic_update_api"&amp;gt;https://api.ionicjs.com&amp;lt;/string&amp;gt;
  &amp;lt;string name="ionic_min_background_duration"&amp;gt;30&amp;lt;/string&amp;gt;
&amp;lt;/resources&amp;gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Then the error will be resolved and live update will done.&lt;br&gt;
Next is additional information while I was solving the problem.&lt;/p&gt;
&lt;h2&gt;
  
  
  2. &lt;code&gt;ionic_update_api&lt;/code&gt;
&lt;/h2&gt;

&lt;p&gt;First, I've got the missing key values from debugging and tracking the code &lt;code&gt;IonicCordovaCommon.java&lt;/code&gt; inside the Android proejct, so I did not know what that mean and what is the appropriate values for that keys. I found a hint from the merged commit (&lt;a href="https://github.com/ionic-team/ionic-cli/pull/4065/files"&gt;https://github.com/ionic-team/ionic-cli/pull/4065/files&lt;/a&gt;), but it was not helpful to find the appropriate value.&lt;br&gt;
Then I typed the value for &lt;code&gt;ionic_update_api&lt;/code&gt; like following:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;string name="ionic_update_api"&amp;gt;https://api.ionicjs.com&amp;lt;/string&amp;gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;and the error happened:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Uncaught SyntaxError: Unexpected token &amp;lt; in JSON at position 0
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;After I resolved the problem, I now know that the api address for checking the update is wrong. I fond the appropriate value &lt;code&gt;https://api.ionicjs.com&lt;/code&gt; googling almost a week. It means that you can manipulate the api address.&lt;br&gt;
I don't understand why this important information cannot be found anywhere.&lt;/p&gt;

&lt;p&gt;Anyway, now the live update is perfectly done.&lt;/p&gt;

&lt;p&gt;you can find the post in the Ionic Forum here: &lt;a href="https://forum.ionicframework.com/t/appflow-live-update-cant-make-it-work/185996/9?u=dotorimook"&gt;https://forum.ionicframework.com/t/appflow-live-update-cant-make-it-work/185996/9?u=dotorimook&lt;/a&gt;&lt;/p&gt;

</description>
      <category>ionic</category>
      <category>appflow</category>
      <category>liveupdate</category>
      <category>deploy</category>
    </item>
    <item>
      <title>Using absolute path import with  Typescript + babel + nodemon in Your Node Project</title>
      <dc:creator>dotorimook</dc:creator>
      <pubDate>Mon, 28 Oct 2019 04:46:10 +0000</pubDate>
      <link>https://dev.to/dotorimook/using-absolute-path-import-with-typescript-babel-nodemon-in-your-node-project-ha7</link>
      <guid>https://dev.to/dotorimook/using-absolute-path-import-with-typescript-babel-nodemon-in-your-node-project-ha7</guid>
      <description>&lt;p&gt;Developing with Node Project, it could be difficult to read your code, and it really feel irritating while importing somany &lt;code&gt;..&lt;/code&gt; in your import code. When you see the path like &lt;code&gt;../../../../../../models/post&lt;/code&gt;, could you even guess where the file is?&lt;/p&gt;

&lt;p&gt;Recently I found various ways to import with absolute path rather than relative path in Typescript Node project, and I finally found simplest configuration for my own.&lt;/p&gt;

&lt;p&gt;You can do this with just &lt;code&gt;babel-plugin-module-resolver&lt;/code&gt;, and &lt;code&gt;tsconfig.json&lt;/code&gt; or &lt;code&gt;@babel/preset-typescript&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;There are 2 ways to use absolute path in your import. Each of them has pros and cons:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Typescript-transpile with &lt;code&gt;tsc&lt;/code&gt;, then babel-transpile with &lt;code&gt;babel-plugin-module-resolver&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Pros&lt;/strong&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;ul&gt;
&lt;li&gt;You do not worry about support of latest grammar because it is official way to transpile typescript.&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;You do not need &lt;code&gt;@babel/preset-typescript&lt;/code&gt;. &lt;code&gt;tsc&lt;/code&gt; will transpile your typescript code.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Cons&lt;/strong&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;You have to transpile twice.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;You have to write path alias information twice, in &lt;code&gt;tsconfig.json&lt;/code&gt; and &lt;code&gt;.babelrc&lt;/code&gt;. It is redundant.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Configure &lt;code&gt;.bablerc&lt;/code&gt; with &lt;code&gt;@babel/preset-typescript&lt;/code&gt; and module-resolver, then transpile your typescript with babel.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Pros&lt;/strong&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;ul&gt;
&lt;li&gt;Simple configuration. You can write path alias information in &lt;code&gt;.babelrc&lt;/code&gt; only.&lt;/li&gt;
&lt;li&gt;You can transpile only one time with babel.&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Furthermore, you can use babel plugin you want (like &lt;code&gt;@babel/plugin-proposal-optional-chaining&lt;/code&gt;. This is one of the features that I want to use with typescript but I can't.)&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Cons&lt;/strong&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Some of Typescript Grammar is not supported.( like &lt;code&gt;!&lt;/code&gt;, null assertion operator)&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;From now, I will show you how to configure each of them. I will suppose to use &lt;code&gt;nodemon&lt;/code&gt; in both ways.&lt;/p&gt;

&lt;h3&gt;
  
  
  0. File Structure
&lt;/h3&gt;

&lt;p&gt;I will suppose the file structure like following:&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;├─src
│├─hello
││ └─abc.ts
│└─index.ts
├─.babelrc
├─nodemon.json
├─package.json
└─tsconfig.json
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;&lt;code&gt;abc.ts&lt;/code&gt; and &lt;code&gt;index.ts&lt;/code&gt; will be like this:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;src/index.ts&lt;/strong&gt;&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import abc from 'hello/abc';
console.log(`Hello, ${abc}`);
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;src/hello/abc.ts&lt;/strong&gt;&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;export default 'abc';
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;package.json&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Some of the packages is not needed by the way you use. You don't need &lt;code&gt;@babel/preset-typescript&lt;/code&gt; if you transpile with &lt;code&gt;tsc&lt;/code&gt; like so forth.&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;{
  "name": "path_hell",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "keywords": [],
  "author": "",
  "license": "ISC",
  "devDependencies": {
    "@babel/core": "^7.6.4",
    "@babel/node": "^7.6.3",
    "@babel/preset-env": "^7.6.3",
    "@babel/preset-typescript": "^7.6.0",
    "@types/jasmine": "^3.4.4",
    "babel-loader": "^8.0.6",
    "babel-plugin-module-resolver": "^3.2.0",
    "jasmine-core": "^3.5.0",
    "karma": "^4.4.1",
    "karma-chrome-launcher": "^3.1.0",
    "karma-jasmine": "^2.0.1",
    "karma-webpack": "^4.0.2",
    "nodemon": "^1.19.4",
    "ts-loader": "^6.2.0",
    "ts-node": "^8.4.1",
    "typescript": "^3.6.4",
    "webpack": "^4.41.2",
    "webpack-dev-server": "^3.8.2"
  }
}
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;h3&gt;
  
  
  1. Typescript-transpile with &lt;code&gt;tsc&lt;/code&gt;, then babel-transpile with &lt;code&gt;babel-plugin-module-resolver&lt;/code&gt;
&lt;/h3&gt;

&lt;p&gt;First, you can write &lt;code&gt;start&lt;/code&gt; script like follow in your &lt;code&gt;package.json&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;package.json&lt;/strong&gt;&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;...
"scripts": {
    "start": "tsc &amp;amp;&amp;amp; nodemon"
  },
...
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;and other configuration file like follow:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;tsconfig.json&lt;/strong&gt;&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;{
  "compilerOptions": {
    "target": "es5",      
    "module": "commonjs",   
    "outDir": "./dist",     
    "strict": true,              
    "moduleResolution": "node",   
    "baseUrl": "src",              
    "paths": {
      "hello": ["./hello"]
    },                         
    "esModuleInterop": true     
  },
}
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;.babelrc&lt;/strong&gt;&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;{
  "presets": [
    "@babel/preset-env"
  ],
  "plugins": [
    ["module-resolver", {
      "root": ["."],
      "alias": {
        "hello": "./dist/hello",
      }
    }]
  ],
}
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;nodemon.json&lt;/strong&gt;&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;{
  "ignore": [
    "node_modules"
  ],
  "watch": [
    "src",
    "yarn.lock"
  ],
  "exec": "babel-node dist/index.js",
  "ext": "ts"
}
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;If you &lt;code&gt;npm start&lt;/code&gt; or &lt;code&gt;yarn start&lt;/code&gt;, then &lt;code&gt;tsc&lt;/code&gt; will transpile your typescript the way you wrote in &lt;code&gt;tsconfig.json&lt;/code&gt;. the &lt;code&gt;baseUrl&lt;/code&gt; and &lt;code&gt;paths&lt;/code&gt; will help resolve your absolute path while tsc transpile. Then, your transpiled code will be run by &lt;code&gt;babel-node&lt;/code&gt;. Wile transpiling with babel, you have to specify given absolute path into what babel can understand, so you have to specify the &lt;code&gt;alias&lt;/code&gt; in the &lt;code&gt;.babelrc&lt;/code&gt; with &lt;code&gt;babel-plugin-module-resolver&lt;/code&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. Configure &lt;code&gt;.bablerc&lt;/code&gt; with &lt;code&gt;@babel/preset-typescript&lt;/code&gt; and module-resolver, then transpile your typescript with babel.
&lt;/h3&gt;

&lt;p&gt;You can make similar effect while configuring only &lt;code&gt;.babelrc&lt;/code&gt; with &lt;code&gt;@babel/preset-typescript&lt;/code&gt; and &lt;code&gt;babel-plugin-module-resolver&lt;/code&gt;. You can write path alias information only 1 time in your &lt;code&gt;.babelrc&lt;/code&gt;, which is very simple.&lt;/p&gt;

&lt;p&gt;First of all, the &lt;code&gt;start&lt;/code&gt; script in &lt;code&gt;package.json&lt;/code&gt; will be different from the first.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;package.json&lt;/strong&gt;&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;...
"scripts": {
    "start": "nodemon"
  },
...
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Then, you have to configure &lt;code&gt;.babelrc&lt;/code&gt; and &lt;code&gt;nodemon.json&lt;/code&gt; like follow:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;.babelrc&lt;/strong&gt;&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;{
  "presets": [
    "@babel/preset-typescript",
    "@babel/preset-env"
  ],
  "plugins": [
    ["module-resolver", {
      "root": ["."],
      "alias": {
        "hello": "./src/hello",
      }
    }]
  ],
}
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;nodemon.json&lt;/strong&gt;&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;{
  "ignore": [
    "node_modules"
  ],
  "watch": [
    "src",
    "yarn.lock"
  ],
  "exec": "babel-node --extensions \".ts\" src/index.ts",
  "ext": "ts"
}
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Done!&lt;/p&gt;

&lt;p&gt;In the code, please focus that &lt;code&gt;alias&lt;/code&gt; field in &lt;code&gt;module-resolver&lt;/code&gt;: from &lt;code&gt;dist&lt;/code&gt; to &lt;code&gt;src&lt;/code&gt;. This way only transpiles your code 1 time, so you don't have to reference tsc-transpiled code path, and you don't have to define &lt;code&gt;paths&lt;/code&gt; in your &lt;code&gt;tsconfig.json&lt;/code&gt;.  Please be careful with nodemon option &lt;code&gt;--extensions ".ts"&lt;/code&gt; that let you transpile your .ts code right a way. If you write &lt;code&gt;'.ts'&lt;/code&gt; rather than typing &lt;code&gt;\".ts\"&lt;/code&gt; , then the error comes. Be careful.&lt;/p&gt;

&lt;p&gt;I prefer the second one because it is simple and capable of using other babel plugins like &lt;code&gt;@babel/plugin-proposal-optional-chaining&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Let's simplify your path with either way!&lt;/p&gt;

&lt;p&gt;You can check the working example in my github repository: &lt;a href="https://github.com/dotorimook/ts-babel-abs-path"&gt;https://github.com/dotorimook/ts-babel-abs-path&lt;/a&gt;&lt;/p&gt;

</description>
      <category>typescript</category>
      <category>babel</category>
      <category>node</category>
      <category>javascript</category>
    </item>
  </channel>
</rss>
