diff --git a/core/core.services.yml b/core/core.services.yml
index 5877a38..5d7653d 100644
--- a/core/core.services.yml
+++ b/core/core.services.yml
@@ -1501,7 +1501,7 @@ services:
       - { name: needs_destruction }
   library.discovery.parser:
     class: Drupal\Core\Asset\LibraryDiscoveryParser
-    arguments: ['@app.root', '@module_handler', '@theme.manager']
+    arguments: ['@app.root', '@module_handler', '@theme.manager', '@info_parser']
   library.dependency_resolver:
     class: Drupal\Core\Asset\LibraryDependencyResolver
     arguments: ['@library.discovery']
diff --git a/core/lib/Drupal/Core/Asset/LibraryDiscoveryParser.php b/core/lib/Drupal/Core/Asset/LibraryDiscoveryParser.php
index 9acda6a..f69299b 100644
--- a/core/lib/Drupal/Core/Asset/LibraryDiscoveryParser.php
+++ b/core/lib/Drupal/Core/Asset/LibraryDiscoveryParser.php
@@ -6,6 +6,7 @@
 use Drupal\Core\Asset\Exception\InvalidLibrariesOverrideSpecificationException;
 use Drupal\Core\Asset\Exception\InvalidLibraryFileException;
 use Drupal\Core\Asset\Exception\LibraryDefinitionMissingLicenseException;
+use Drupal\Core\Extension\InfoParserInterface;
 use Drupal\Core\Extension\ModuleHandlerInterface;
 use Drupal\Core\Theme\ThemeManagerInterface;
 use Drupal\Component\Serialization\Exception\InvalidDataTypeException;
@@ -31,6 +32,13 @@ class LibraryDiscoveryParser {
    */
   protected $themeManager;
 
+  /**
+   * The info parser.
+   *
+   * @var \Drupal\Core\Extension\InfoParserInterface
+   */
+  protected $infoParser;
+
   /**
    * The app root.
    *
@@ -47,11 +55,14 @@ class LibraryDiscoveryParser {
    *   The module handler.
    * @param \Drupal\Core\Theme\ThemeManagerInterface $theme_manager
    *   The theme manager.
+   * @param \Drupal\Core\Extension\InfoParserInterface $info_parser
+   *   The info parser.
    */
-  public function __construct($root, ModuleHandlerInterface $module_handler, ThemeManagerInterface $theme_manager) {
+  public function __construct($root, ModuleHandlerInterface $module_handler, ThemeManagerInterface $theme_manager, InfoParserInterface $info_parser) {
     $this->root = $root;
     $this->moduleHandler = $module_handler;
     $this->themeManager = $theme_manager;
+    $this->infoParser = $info_parser;
   }
 
   /**
@@ -99,9 +110,18 @@ public function buildByExtension($extension) {
       }
 
       if (isset($library['version'])) {
-        // @todo Retrieve version of a non-core extension.
         if ($library['version'] === 'VERSION') {
-          $library['version'] = \Drupal::VERSION;
+          if ($extension_type === 'core' || strpos($path, 'core/modules/') === 0) {
+            $library['version'] = \Drupal::VERSION;
+          }
+          elseif ($extension_type === 'module') {
+            $info = $this->infoParser->parse($this->moduleHandler->getModule($extension)->getPathname());
+            $library['version'] = !empty($info['version']) ? $info['version'] : \Drupal::VERSION;
+          }
+          elseif ($extension_type === 'theme') {
+            $info = $this->infoParser->parse($this->themeManager->getActiveTheme()->getExtension()->getPathname());
+            $library['version'] = !empty($info['version']) ? $info['version'] : \Drupal::VERSION;
+          }
         }
         // Remove 'v' prefix from external library versions.
         elseif ($library['version'][0] === 'v') {
diff --git a/core/tests/Drupal/Tests/Core/Asset/LibraryDiscoveryParserTest.php b/core/tests/Drupal/Tests/Core/Asset/LibraryDiscoveryParserTest.php
index ed0c9ce..b215cea 100644
--- a/core/tests/Drupal/Tests/Core/Asset/LibraryDiscoveryParserTest.php
+++ b/core/tests/Drupal/Tests/Core/Asset/LibraryDiscoveryParserTest.php
@@ -44,6 +44,13 @@ class LibraryDiscoveryParserTest extends UnitTestCase {
    */
   protected $themeManager;
 
+  /**
+   * The mocked info parser.
+   *
+   * @var \Drupal\Core\Extension\InfoParserInterface|\PHPUnit_Framework_MockObject_MockObject
+   */
+  protected $infoParser;
+
   /**
    * The mocked lock backend.
    *
@@ -59,6 +66,7 @@ protected function setUp() {
 
     $this->moduleHandler = $this->getMock('Drupal\Core\Extension\ModuleHandlerInterface');
     $this->themeManager = $this->getMock('Drupal\Core\Theme\ThemeManagerInterface');
+    $this->infoParser = $this->getMock('\Drupal\Core\Extension\InfoParser');
     $mock_active_theme = $this->getMockBuilder('Drupal\Core\Theme\ActiveTheme')
       ->disableOriginalConstructor()
       ->getMock();
@@ -68,7 +76,7 @@ protected function setUp() {
     $this->themeManager->expects($this->any())
       ->method('getActiveTheme')
       ->willReturn($mock_active_theme);
-    $this->libraryDiscoveryParser = new TestLibraryDiscoveryParser($this->root, $this->moduleHandler, $this->themeManager);
+    $this->libraryDiscoveryParser = new TestLibraryDiscoveryParser($this->root, $this->moduleHandler, $this->themeManager, $this->infoParser);
   }
 
   /**
@@ -82,6 +90,18 @@ public function testBuildByExtensionSimple() {
       ->with('example_module')
       ->will($this->returnValue(TRUE));
 
+    $mockExtension = $this->getMockBuilder('Drupal\Core\Extension\Extension')
+      ->disableOriginalConstructor()
+      ->getMock();
+    $this->moduleHandler->expects($this->atLeastOnce())
+      ->method('getModule')
+      ->with('example_module')
+      ->will($this->returnValue($mockExtension));
+
+    $this->infoParser->expects($this->atLeastOnce())
+      ->method('parse')
+      ->will($this->returnValue(['version' => '1.2.3']));
+
     $path = __DIR__ . '/library_test_files';
     $path = substr($path, strlen($this->root) + 1);
     $this->libraryDiscoveryParser->setPaths('module', 'example_module', $path);
@@ -95,7 +115,7 @@ public function testBuildByExtensionSimple() {
     $this->assertEquals($path . '/css/example.css', $library['css'][0]['data']);
 
     // Ensures that VERSION is replaced by the current core version.
-    $this->assertEquals(\Drupal::VERSION, $library['version']);
+    $this->assertEquals('1.2.3', $library['version']);
   }
 
   /**
@@ -192,6 +212,18 @@ public function testVersion() {
       ->with('versions')
       ->will($this->returnValue(TRUE));
 
+    $mockExtension = $this->getMockBuilder('Drupal\Core\Extension\Extension')
+      ->disableOriginalConstructor()
+      ->getMock();
+    $this->moduleHandler->expects($this->atLeastOnce())
+      ->method('getModule')
+      ->with('versions')
+      ->will($this->returnValue($mockExtension));
+
+    $this->infoParser->expects($this->atLeastOnce())
+      ->method('parse')
+      ->will($this->returnValue(['version' => '1.2.3']));
+
     $path = __DIR__ . '/library_test_files';
     $path = substr($path, strlen($this->root) + 1);
     $this->libraryDiscoveryParser->setPaths('module', 'versions', $path);
@@ -206,9 +238,9 @@ public function testVersion() {
     $this->assertEquals('9.8.7.6', $libraries['versioned']['css'][0]['version']);
     $this->assertEquals('9.8.7.6', $libraries['versioned']['js'][0]['version']);
 
-    $this->assertEquals(\Drupal::VERSION, $libraries['core-versioned']['version']);
-    $this->assertEquals(\Drupal::VERSION, $libraries['core-versioned']['css'][0]['version']);
-    $this->assertEquals(\Drupal::VERSION, $libraries['core-versioned']['js'][0]['version']);
+    $this->assertEquals('1.2.3', $libraries['module-versioned']['version']);
+    $this->assertEquals('1.2.3', $libraries['module-versioned']['css'][0]['version']);
+    $this->assertEquals('1.2.3', $libraries['module-versioned']['js'][0]['version']);
   }
 
   /**
@@ -227,6 +259,16 @@ public function testNonStringVersion() {
       ->with('versions')
       ->will($this->returnValue(TRUE));
 
+    // Need to mock this because the 'module-versioned' library is still
+    // processed.
+    $mockExtension = $this->getMockBuilder('Drupal\Core\Extension\Extension')
+      ->disableOriginalConstructor()
+      ->getMock();
+    $this->moduleHandler
+      ->method('getModule')
+      ->with('versions')
+      ->will($this->returnValue($mockExtension));
+
     $path = __DIR__ . '/library_test_files';
     $path = substr($path, strlen($this->root) + 1);
     $this->libraryDiscoveryParser->setPaths('module', 'versions', $path);
diff --git a/core/tests/Drupal/Tests/Core/Asset/library_test_files/versions.libraries.yml b/core/tests/Drupal/Tests/Core/Asset/library_test_files/versions.libraries.yml
index bee49f5..1b5d77a 100644
--- a/core/tests/Drupal/Tests/Core/Asset/library_test_files/versions.libraries.yml
+++ b/core/tests/Drupal/Tests/Core/Asset/library_test_files/versions.libraries.yml
@@ -13,13 +13,13 @@ versioned:
   js:
     versioned.js: {}
 
-core-versioned:
+module-versioned:
   version: VERSION
   css:
     theme:
-      core-versioned.css: {}
+      module-versioned.css: {}
   js:
-    core-versioned.js: {}
+    module-versioned.js: {}
 
 invalid-version:
   version: 2014-12-13
