在VUE项目中添加使用LivePlayer.js直播点播H5免费播放器 ,开发模式下可正常运行,打包出现Cannot find module "video.js",有遇到这样问题?

使用 vue-cli, 编辑 vue.config.js

const CopyWebpackPlugin = require('copy-webpack-plugin');

module.exports = {

externals: {

'video.js': 'videojs',

'flv.js': 'flvjs'

},

configureWebpack: {

plugins: [

new CopyWebpackPlugin([

{ from: 'externals' },

{ from: 'node_modules/@liveqing/liveplayer/dist/component/crossdomain.xml'},

{ from: 'node_modules/@liveqing/liveplayer/dist/component/liveplayer.swf'}

{ from: 'node_modules/@liveqing/liveplayer/dist/component/liveplayer-lib.min.js', to: 'js/'},

])

]

}

}


回答:

import videojs from 'video.js';

import flvjs from 'flv.js';

以上是 在VUE项目中添加使用LivePlayer.js直播点播H5免费播放器 ,开发模式下可正常运行,打包出现Cannot find module "video.js",有遇到这样问题? 的全部内容, 来源链接: utcz.com/p/934564.html

回到顶部