6

When I add a library (in my case it is jplayer) I got error

external "vendor_d73928c…":1 Uncaught ReferenceError: vendor_d73928c989153b363873 is not defined

at line module.exports = vendor_d73928c989153b363873 in file webpack:///external "vendor_d73928c989153b363873"

Here is my code (which add vendor jplayer).

entry: {
    vendor: [
        'bootstrap',
        'bootstrap/dist/css/bootstrap.css',
        'font-awesome/css/font-awesome.css',
        'style-loader',
        'jquery',
        '@angular/common',
        '@angular/compiler',
        '@angular/core',
        '@angular/http',
        '@angular/platform-browser',
        '@angular/platform-browser-dynamic',
        '@angular/router',
        '@angular/platform-server',
        'angular2-google-maps/core',
        'jplayer'
    ]
},

Do I missing something?

Andrei Zhytkevich
  • 8,039
  • 2
  • 31
  • 45
Phan Hoàng Nhân
  • 990
  • 1
  • 8
  • 21
  • 1
    `jplayer/dist/**/*.+(js|css|html|gif|png|swf)` is this helpful? – KB_ Jul 28 '16 at 11:08
  • No it not work, it return error when I run `webpack` in cmd > ERROR in dll vendor Module not found: Error: Cannot resolve module 'jplayer/dist/**/*.+(js|css|html|gif|png|swf)' in F:\code\KOAIT\Makanikai\LanaiNew\Lanai @ dll vendor – Phan Hoàng Nhân Jul 29 '16 at 02:20

1 Answers1

19

I found the solution. Just exit visual studio, run webpack --config webpack.config.vendor.js webpack in cmd, in the project folder. After that, open visual studio again

Phan Hoàng Nhân
  • 990
  • 1
  • 8
  • 21