Handling path to assets (css, js) between local and production environment
If you are using Craft 3 Multi-Environment then you can add environment specific aliases to those assets in your general config file.

Eg: 

// Live (production) environment
'live' =&gt; [
    // Craft defined config settings
    'allowUpdates' =&gt; false,
    'backupOnUpdate' =&gt; false,
    'devMode' =&gt; false,
    'enableTemplateCaching' =&gt; true,
    'isSystemOn' =&gt; true,
    // Aliases parsed in sites’ settings, volumes’ settings, and Local 
    volumes’ settings
    'aliases' =&gt; [
      '@assetPath' =&gt; '/dist/'
    ],
    // Custom site-specific config settings
    'custom' =&gt; [

    ]
],


Then, in your templates you can use {{ alias('@assetPath/js/' }}.

Note, while I've called the alias assetPath, you can name it anything you like.