Skip to content

Commit

Permalink
Fix for webpack config in the examples project
Browse files Browse the repository at this point in the history
  • Loading branch information
gpbl committed Jun 8, 2016
1 parent bbb6d1e commit ec6795e
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 11 deletions.
21 changes: 13 additions & 8 deletions examples/src/Examples.js
Expand Up @@ -131,14 +131,19 @@ export default class Examples extends Component {
}

renderNavBarExamples() {
const links = Object.keys(EXAMPLES).map(name => <a
href={`.?${name}`}
onClick={e => { e.preventDefault(); history.push({ pathname: '.', search: `?${name}` }); }}
key={name}
className={this.state.currentExample === name ? 'selected' : ''}
>
{EXAMPLES[name].title}
</a>);
const links = Object.keys(EXAMPLES).map(name =>
<a
href={`.?${name}`}
onClick={e => {
e.preventDefault();
history.push({ pathname: history.getCurrentLocation().pathname, search: `?${name}` });
}}
key={name}
className={this.state.currentExample === name ? 'selected' : ''}
>
{EXAMPLES[name].title}
</a>
);
return <div className="NavBar-links">{links}</div>;
}

Expand Down
15 changes: 12 additions & 3 deletions examples/webpack.config.js
Expand Up @@ -11,19 +11,28 @@ module.exports = {
filename: 'main.js',
},

resolve: { extensions: ['', '.js'] },

module: {
loaders: [{
test: /\.js$/,
exclude: /node_modules/,
include: [
path.join(__dirname, '../src'),
path.join(__dirname, './src'),
path.join(__dirname, '../dist'),
],
loaders: ['babel'],
}, {
test: /\.css$/,
loaders: ['style', 'css', 'autoprefixer-loader?browsers=last 2 version'],
}],
},

resolve: {
extensions: ['', '.js'],
alias: {
react: path.resolve(__dirname, '../node_modules/react'),
},
},

plugins: [

// ignore moment locales
Expand Down

0 comments on commit ec6795e

Please sign in to comment.