Use webtorrent as external dependency instead of building it with

webpack
pull/10/head
Chocobozzz 2016-06-04 13:08:38 +02:00
parent f0dc9602f9
commit 7f82b8ae37
5 changed files with 22 additions and 8 deletions

View File

@ -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'
})
],

View File

@ -85,6 +85,10 @@ module.exports = webpackMerge(commonConfig, {
},
externals: {
webtorrent: 'WebTorrent'
},
plugins: [
/**

View File

@ -83,6 +83,10 @@ module.exports = webpackMerge(commonConfig, {
},
externals: {
webtorrent: 'WebTorrent'
},
/**
* Add additional plugins to the compiler.
*

View File

@ -8,6 +8,9 @@
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" href="/client/assets/favicon.ico" />
<!-- TODO: bundle it with webpack when https://github.com/webpack/webpack/pull/1931 will be merged -->
<script src="/client/assets/webtorrent/webtorrent.min.js"></script>
</head>
<!-- 3. Display the application -->

View File

@ -19,5 +19,3 @@ import 'jquery';
import 'bootstrap-loader';
import 'jquery.ui.widget/jquery.ui.widget';
import 'blueimp-file-upload';
// TODO: build webtorrent with webpack when https://github.com/webpack/webpack/pull/1931 will be merged
import 'webtorrent/webtorrent.min';