From c21f59d334b748be99188688c9578c9cd5432874 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Sat, 4 Jun 2016 10:05:17 +0200 Subject: [PATCH] Add webtorrent and jquery to webpack --- client/.bootstraprc | 6 +++--- client/config/webpack.common.js | 9 +++++++-- client/config/webpack.prod.js | 1 - client/src/vendor.ts | 4 ++++ 4 files changed, 14 insertions(+), 6 deletions(-) diff --git a/client/.bootstraprc b/client/.bootstraprc index a4d4fe689..76a0bdb7b 100644 --- a/client/.bootstraprc +++ b/client/.bootstraprc @@ -90,13 +90,13 @@ styles: badges: false jumbotron: false thumbnails: true - alerts: false + alerts: true progress-bars: true media: true list-group: false panels: false wells: false - responsive-embed: false + responsive-embed: true close: false # Components w/ JavaScript @@ -112,7 +112,7 @@ styles: ### Bootstrap scripts scripts: transition: false - alert: false + alert: true button: false carousel: false collapse: false diff --git a/client/config/webpack.common.js b/client/config/webpack.common.js index abbf84fb0..a48518a35 100644 --- a/client/config/webpack.common.js +++ b/client/config/webpack.common.js @@ -68,7 +68,9 @@ module.exports = { root: helpers.root('src'), // remove other default values - modulesDirectories: [ 'node_modules' ] + modulesDirectories: [ 'node_modules', 'node_modules/blueimp-file-upload/js/vendor' ], + + packageAlias: 'browser' }, @@ -243,7 +245,8 @@ module.exports = { new webpack.ProvidePlugin({ jQuery: 'jquery', $: 'jquery', - jquery: 'jquery' + jquery: 'jquery', + WebTorrent: 'webtorrent/webtorrent.min' }) ], @@ -257,6 +260,8 @@ module.exports = { node: { global: 'window', crypto: 'empty', + fs: 'empty', + events: true, module: false, clearImmediate: false, setImmediate: false diff --git a/client/config/webpack.prod.js b/client/config/webpack.prod.js index 23e2fabfe..8827888a3 100644 --- a/client/config/webpack.prod.js +++ b/client/config/webpack.prod.js @@ -9,7 +9,6 @@ const commonConfig = require('./webpack.common.js') // the settings that are com /** * Webpack Plugins */ -const ProvidePlugin = require('webpack/lib/ProvidePlugin') const DefinePlugin = require('webpack/lib/DefinePlugin') const DedupePlugin = require('webpack/lib/optimize/DedupePlugin') const UglifyJsPlugin = require('webpack/lib/optimize/UglifyJsPlugin') diff --git a/client/src/vendor.ts b/client/src/vendor.ts index 7a8c8423e..dcc4439db 100644 --- a/client/src/vendor.ts +++ b/client/src/vendor.ts @@ -17,3 +17,7 @@ import 'rxjs/add/operator/mergeMap'; 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';