*
* 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
new webpack.ProvidePlugin({
jQuery: 'jquery',
$: 'jquery',
- jquery: 'jquery',
- WebTorrent: 'webtorrent/webtorrent.min'
+ jquery: 'jquery'
})
],
},
+ externals: {
+ webtorrent: 'WebTorrent'
+ },
+
plugins: [
/**
},
+ externals: {
+ webtorrent: 'WebTorrent'
+ },
+
/**
* Add additional plugins to the compiler.
*
<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 -->
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';