Skip to content

Commit

Permalink
Use dynamic version of emoji-datasource for the default sheet URL
Browse files Browse the repository at this point in the history
  • Loading branch information
EtienneLem committed Dec 1, 2016
1 parent 0d39e10 commit 462ba0c
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 2 deletions.
8 changes: 8 additions & 0 deletions example/webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
var path = require('path')
var pack = require('../package.json')
var webpack = require('webpack')

module.exports = {
entry: path.resolve('example/index.js'),
Expand Down Expand Up @@ -31,4 +33,10 @@ module.exports = {
resolve: {
extensions: ['', '.js'],
},

plugins: [
new webpack.DefinePlugin({
EMOJI_DATASOURCE_VERSION: `'${pack.devDependencies['emoji-datasource']}'`,
}),
],
}
2 changes: 1 addition & 1 deletion src/components/emoji.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,8 @@ Emoji.defaultProps = {
set: 'apple',
sheetSize: 64,
native: false,
backgroundImageFn: ((set, sheetSize) => `https://unpkg.com/emoji-datasource@${EMOJI_DATASOURCE_VERSION}/sheet_${set}_${sheetSize}.png`),
onOver: (() => {}),
backgroundImageFn: ((set, sheetSize) => `https://unpkg.com/emoji-datasource@2.4.4/sheet_${set}_${sheetSize}.png`),
onLeave: (() => {}),
onClick: (() => {}),
}
9 changes: 8 additions & 1 deletion src/webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
var path = require('path')
var pack = require('../package.json')
var webpack = require('webpack')

module.exports = {
entry: path.resolve('src/index.js'),
Expand Down Expand Up @@ -42,6 +44,11 @@ module.exports = {
extensions: ['', '.js'],
},

plugins: [],
plugins: [
new webpack.DefinePlugin({
EMOJI_DATASOURCE_VERSION: `'${pack.devDependencies['emoji-datasource']}'`,
}),
],

bail: true,
}

0 comments on commit 462ba0c

Please sign in to comment.