Created
January 12, 2016 10:42
-
-
Save anilGupta/31888417a0eb0fdad7bc to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//webpack.config.js | |
const config = { | |
externals: { | |
'window': 'Window' | |
}, | |
resolve: { | |
extensions: ['', '.webpack.js', '.web.js', '.js', '.jsx', '.json'], | |
alias: { | |
'jwplayer': path.join(__dirname, '../src/components/VideoPage/lib/jwplayer.js') | |
} | |
}, | |
module: { | |
loaders: [ | |
{ | |
test: /\.jsx?$/, | |
include: [ | |
path.resolve(__dirname, '../node_modules/react-routing/src'), | |
path.resolve(__dirname, '../src'), | |
], | |
loader: 'babel-loader', | |
}, | |
{ | |
test: /\.scss$/, | |
loaders: [ | |
'isomorphic-style-loader', | |
'css-loader?' + (DEBUG ? 'sourceMap&' : 'minimize&') + | |
'modules&localIdentName=[name]_[local]_[hash:base64:3]', | |
'postcss-loader', | |
], | |
}, { | |
test: /\.json$/, | |
loader: 'json-loader', | |
}, { | |
test: /\.txt$/, | |
loader: 'raw-loader', | |
}, { | |
test: /\.(png|jpg|jpeg|gif|svg|woff|woff2|eot|ttf)(\?.*$|$)/, | |
loader: 'url-loader?limit=10000', | |
}, { | |
test: /\.(eot|ttf|wav|mp3)$/, | |
loader: 'file-loader', | |
}, | |
{ | |
test: /jwplayer.js$/, | |
loader: 'expose?jwplayer' | |
} | |
], | |
} | |
}; | |
//my react component VideoPage.js | |
import React, { Component, PropTypes } from 'react'; | |
import s from './LoginPage.scss'; | |
import withStyles from '../../decorators/withStyles'; | |
import jwplayer from 'jwplayer' | |
@withStyles(s) | |
class VideoPage extends Component { | |
componentWillMount() { | |
console.log(jwplayer); | |
} | |
render() { | |
return ( | |
<div className={s.root}> | |
</div> | |
); | |
} | |
} | |
export default VideoPage; | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
i am getting following error