diff options
author | Chocobozzz <florian.bigard@gmail.com> | 2016-06-04 13:08:38 +0200 |
---|---|---|
committer | Chocobozzz <florian.bigard@gmail.com> | 2016-06-04 13:08:38 +0200 |
commit | 7f82b8ae377214dd9b3f13a76a5e5f4e963e9425 (patch) | |
tree | 70b9876e599ee510ccf8133418b98daeeb44e4d9 /client | |
parent | f0dc9602f9ef507370bf774d953b5b3bc7b75243 (diff) | |
download | PeerTube-7f82b8ae377214dd9b3f13a76a5e5f4e963e9425.tar.gz PeerTube-7f82b8ae377214dd9b3f13a76a5e5f4e963e9425.tar.zst PeerTube-7f82b8ae377214dd9b3f13a76a5e5f4e963e9425.zip |
Use webtorrent as external dependency instead of building it with
webpack
Diffstat (limited to 'client')
-rw-r--r-- | client/config/webpack.common.js | 17 | ||||
-rw-r--r-- | client/config/webpack.dev.js | 4 | ||||
-rw-r--r-- | client/config/webpack.prod.js | 4 | ||||
-rw-r--r-- | client/src/index.html | 3 | ||||
-rw-r--r-- | client/src/vendor.ts | 2 |
5 files changed, 22 insertions, 8 deletions
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 = { | |||
222 | * | 222 | * |
223 | * See: https://www.npmjs.com/package/copy-webpack-plugin | 223 | * See: https://www.npmjs.com/package/copy-webpack-plugin |
224 | */ | 224 | */ |
225 | new CopyWebpackPlugin([{ | 225 | new CopyWebpackPlugin([ |
226 | from: 'src/assets', | 226 | { |
227 | to: 'assets' | 227 | from: 'src/assets', |
228 | }]), | 228 | to: 'assets' |
229 | }, | ||
230 | { | ||
231 | from: 'node_modules/webtorrent/webtorrent.min.js', | ||
232 | to: 'assets/webtorrent' | ||
233 | } | ||
234 | ]), | ||
229 | 235 | ||
230 | /* | 236 | /* |
231 | * Plugin: HtmlWebpackPlugin | 237 | * Plugin: HtmlWebpackPlugin |
@@ -243,8 +249,7 @@ module.exports = { | |||
243 | new webpack.ProvidePlugin({ | 249 | new webpack.ProvidePlugin({ |
244 | jQuery: 'jquery', | 250 | jQuery: 'jquery', |
245 | $: 'jquery', | 251 | $: 'jquery', |
246 | jquery: 'jquery', | 252 | jquery: 'jquery' |
247 | WebTorrent: 'webtorrent/webtorrent.min' | ||
248 | }) | 253 | }) |
249 | 254 | ||
250 | ], | 255 | ], |
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, { | |||
85 | 85 | ||
86 | }, | 86 | }, |
87 | 87 | ||
88 | externals: { | ||
89 | webtorrent: 'WebTorrent' | ||
90 | }, | ||
91 | |||
88 | plugins: [ | 92 | plugins: [ |
89 | 93 | ||
90 | /** | 94 | /** |
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, { | |||
83 | 83 | ||
84 | }, | 84 | }, |
85 | 85 | ||
86 | externals: { | ||
87 | webtorrent: 'WebTorrent' | ||
88 | }, | ||
89 | |||
86 | /** | 90 | /** |
87 | * Add additional plugins to the compiler. | 91 | * Add additional plugins to the compiler. |
88 | * | 92 | * |
diff --git a/client/src/index.html b/client/src/index.html index 83f4cc8f0..c45ab6b6f 100644 --- a/client/src/index.html +++ b/client/src/index.html | |||
@@ -8,6 +8,9 @@ | |||
8 | <meta name="viewport" content="width=device-width, initial-scale=1"> | 8 | <meta name="viewport" content="width=device-width, initial-scale=1"> |
9 | 9 | ||
10 | <link rel="icon" href="/client/assets/favicon.ico" /> | 10 | <link rel="icon" href="/client/assets/favicon.ico" /> |
11 | |||
12 | <!-- TODO: bundle it with webpack when https://github.com/webpack/webpack/pull/1931 will be merged --> | ||
13 | <script src="/client/assets/webtorrent/webtorrent.min.js"></script> | ||
11 | </head> | 14 | </head> |
12 | 15 | ||
13 | <!-- 3. Display the application --> | 16 | <!-- 3. Display the application --> |
diff --git a/client/src/vendor.ts b/client/src/vendor.ts index dcc4439db..6d7ebc3b4 100644 --- a/client/src/vendor.ts +++ b/client/src/vendor.ts | |||
@@ -19,5 +19,3 @@ import 'jquery'; | |||
19 | import 'bootstrap-loader'; | 19 | import 'bootstrap-loader'; |
20 | import 'jquery.ui.widget/jquery.ui.widget'; | 20 | import 'jquery.ui.widget/jquery.ui.widget'; |
21 | import 'blueimp-file-upload'; | 21 | import 'blueimp-file-upload'; |
22 | // TODO: build webtorrent with webpack when https://github.com/webpack/webpack/pull/1931 will be merged | ||
23 | import 'webtorrent/webtorrent.min'; | ||