Scope javascripts to be outside admin
Sure. Drupal 8 still allows #attached, the difference is just that you specify a library instead of a specific javascript file, but that is irrelevant for your question.

You can implement hook_page_attachments() and ask the route context if this is an admin route.

/**
 * Implements hook_page_attachments().
 */
function yourmodule_page_attachments(&amp;$page) {
  // This returns TRUE for admin paths.
  if (!\Drupal::service('router.admin_context')-&gt;isAdminRoute()) {
    $page['#attached']['library'][] = 'yourmodule/yourlibrary';
  }
}