Skip to content

Commit

Permalink
Added bower, and fixed npm css peer-dep
Browse files Browse the repository at this point in the history
  • Loading branch information
unimonkiez committed Apr 27, 2016
1 parent e9d304e commit 1274b5d
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 14 deletions.
1 change: 1 addition & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
src/
dist/
example/
.editorconfig
Expand Down
5 changes: 4 additions & 1 deletion bin/bump.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
const execSync = require('child_process').execSync;
const bump = process.argv[2] || 'patch';

execSync(`npm version ${bump}`, {
execSync(`npm version ${bump} --no-git-tag-version`, {
stdio: [0, 1, 2]
});
execSync(`bower version ${bump}`, {
stdio: [0, 1, 2]
});
15 changes: 15 additions & 0 deletions bower.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"name": "emoji-panel.js",
"version": "0.1.1",
"description": "Add panel picker for emojis with different types of sets on your website. http://TimeToKnow.github.io/emoji-panel/",
"main": [
"dist/emoji-panel.js",
"dist/emoji-panel-apple-32.css"
],
"ignore": [],
"homepage": "https://github.com/TimeToKnow/emoji-panel",
"authors": [
"unimonkiez <[email protected]>"
],
"license": "MIT"
}
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"start": "webpack-dev-server --port 8080 --inline --progress --colors --config ./webpack.dev.config.js",
"start:prod": "set NODE_ENV=production&& npm start",
"predeploy": "set NODE_ENV=development&& npm run build && npm run lib && set NODE_ENV=production&& npm run build",
"deploy": "git add -f dist && git add -f dist/* && git commit -m \"Autogenerated commit for dist files\" && node ./bin/bump.js && git checkout gh-pages && git merge master && git checkout master && git push --tags && npm publish && git push origin master gh-pages"
"deploy": "git add -f dist && git add -f dist/* && git commit -m \"Autogenerated commit for dist files\" && node ./bin/bump.js && git checkout gh-pages && git merge master && git checkout master && git push origin master gh-pages --follow-tags && npm publish"
},
"repository": {
"type": "git",
Expand All @@ -27,7 +27,7 @@
"google"
],
"author": "unimonkiez",
"license": "ISC",
"license": "MIT",
"peerDependencies": {
"emoji-data": "git+https://github.com/iamcal/emoji-data.git#v2.4.1"
},
Expand All @@ -37,6 +37,7 @@
"babel-eslint": "^6.0.2",
"babel-loader": "^6.2.4",
"babel-preset-es2015": "^6.6.0",
"bower": "^1.7.9",
"css-loader": "^0.23.1",
"eslint": "^2.7.0",
"extract-text-webpack-plugin": "^1.0.1",
Expand All @@ -50,7 +51,6 @@
"rimraf": "^2.5.2",
"sass-loader": "^3.2.0",
"style-loader": "^0.13.1",
"url-loader": "^0.5.7",
"webpack": "^1.12.15",
"webpack-dev-server": "^1.14.1"
}
Expand Down
2 changes: 1 addition & 1 deletion webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ module.exports = {
},
{
test: /\.(png|ttf)$/,
loader: 'url?limit=20000&name=./asset/[hash].[ext]'
loader: 'file?name=./asset/[hash].[ext]'
}
]
},
Expand Down
16 changes: 7 additions & 9 deletions webpack.lib.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,13 @@ Object.assign(webpackBaseConfig, {
umdNamedDefine: true
}),
module: Object.assign(webpackBaseConfig.module, {
loaders: webpackBaseConfig.module.loaders.map(loaderObj => {
const loaderTestString = loaderObj.test.toString();
if (loaderTestString === /\.(png|ttf)$/.toString()) {
return Object.assign(loaderObj, {
loader: 'file?name=../[path][name].[ext]' // So it won't copy the file to lib folder, only point to it's own location
});
} else {
return loaderObj;
loaders: webpackBaseConfig.module.loaders
.filter(loaderObj => loaderObj.test.toString() !== /\.acss.js$/.toString()) // Remove loader to add it later wiht different loader
.concat(
{
test: /\.acss.js$/,
loader: ExtractTextPlugin.extract('style', 'absurd') // Without css-loader so it won't resolve file imports
}
})
)
})
});

0 comments on commit 1274b5d

Please sign in to comment.