From 7f82b8ae377214dd9b3f13a76a5e5f4e963e9425 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Sat, 4 Jun 2016 13:08:38 +0200 Subject: Use webtorrent as external dependency instead of building it with webpack --- client/config/webpack.common.js | 17 +++++++++++------ client/config/webpack.dev.js | 4 ++++ client/config/webpack.prod.js | 4 ++++ 3 files changed, 19 insertions(+), 6 deletions(-) (limited to 'client/config') diff --git a/client/config/webpack.common.js b/client/config/webpack.common.js index 653866b93..7f1da74b9 100644 --- a/client/config/webpack.common.js +++ b/client/config/webpack.common.js @@ -222,10 +222,16 @@ module.exports = { * * See: https://www.npmjs.com/package/copy-webpack-plugin */ - new CopyWebpackPlugin([{ - from: 'src/assets', - to: 'assets' - }]), + new CopyWebpackPlugin([ + { + from: 'src/assets', + to: 'assets' + }, + { + from: 'node_modules/webtorrent/webtorrent.min.js', + to: 'assets/webtorrent' + } + ]), /* * Plugin: HtmlWebpackPlugin @@ -243,8 +249,7 @@ module.exports = { new webpack.ProvidePlugin({ jQuery: 'jquery', $: 'jquery', - jquery: 'jquery', - WebTorrent: 'webtorrent/webtorrent.min' + jquery: 'jquery' }) ], diff --git a/client/config/webpack.dev.js b/client/config/webpack.dev.js index 8c6d1aac7..50193bf58 100644 --- a/client/config/webpack.dev.js +++ b/client/config/webpack.dev.js @@ -85,6 +85,10 @@ module.exports = webpackMerge(commonConfig, { }, + externals: { + webtorrent: 'WebTorrent' + }, + plugins: [ /** diff --git a/client/config/webpack.prod.js b/client/config/webpack.prod.js index 8827888a3..7ce5727d3 100644 --- a/client/config/webpack.prod.js +++ b/client/config/webpack.prod.js @@ -83,6 +83,10 @@ module.exports = webpackMerge(commonConfig, { }, + externals: { + webtorrent: 'WebTorrent' + }, + /** * Add additional plugins to the compiler. * -- cgit v1.2.3