diff --git a/template/build/vue-loader.conf.js b/template/build/vue-loader.conf.js index 7aee79bae4..8a346d5222 100644 --- a/template/build/vue-loader.conf.js +++ b/template/build/vue-loader.conf.js @@ -8,5 +8,11 @@ module.exports = { ? config.build.productionSourceMap : config.dev.cssSourceMap, extract: isProduction - }) + }), + transformToRequire: { + video: 'src', + source: 'src', + img: 'src', + image: 'xlink:href' + } } diff --git a/template/build/webpack.base.conf.js b/template/build/webpack.base.conf.js index 0f161198d4..71f0fdcf87 100644 --- a/template/build/webpack.base.conf.js +++ b/template/build/webpack.base.conf.js @@ -58,6 +58,14 @@ module.exports = { name: utils.assetsPath('img/[name].[hash:7].[ext]') } }, + { + test: /\.(mp4|webm|ogg|mp3|wav|flac|aac)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('media/[name].[hash:7].[ext]') + } + }, { test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/, loader: 'url-loader',