Skip to content

Commit

Permalink
using ProviderPlugin to add React/ReactDOM/jquery instead of adding s…
Browse files Browse the repository at this point in the history
…tatic JS files in html
  • Loading branch information
andrewcapodieci committed Jul 28, 2017
1 parent b208e89 commit 8bfe36a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
3 changes: 0 additions & 3 deletions src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@

<html>
<head>
<script src="https://fb.me/react-15.3.0.js"></script>
<script src="https://fb.me/react-dom-15.3.0.js"></script>
<script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/jquery/2.2.2/jquery.min.js"></script>
<script type="text/javascript" src="https://golden-layout.com/files/latest/js/goldenlayout.min.js"></script>
<link type="text/css" rel="stylesheet" href="https://golden-layout.com/files/latest/css/goldenlayout-base.css" />
<link type="text/css" rel="stylesheet" href="https://golden-layout.com/assets/css/goldenlayout-dark-theme.css" />
Expand Down
8 changes: 8 additions & 0 deletions webpack.config.babel.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import path from 'path';
import HtmlWebpackPlugin from 'html-webpack-plugin';
import webpack from 'webpack';

export default () => ({
entry: [
Expand All @@ -14,6 +15,13 @@ export default () => ({
new HtmlWebpackPlugin({
filename: 'index.html',
template: './src/index.html'
}),
// Necessary b/c golden-layout depends on all 3 of these libs via UMD globals
new webpack.ProvidePlugin({
React: 'react',
ReactDOM: 'react-dom',
$: 'jquery',
jQuery: 'jquery'
})
],
module: {
Expand Down

0 comments on commit 8bfe36a

Please sign in to comment.