forked from FormidableLabs/radium
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove babel from deps before publish
@adamdicarlo had a fantastic idea to move the babel dependencies to devDependencies before publishing. That way, they are still there for git installs, but npm installs, which are the fast majority, are much faster. I tested this by publishing `0.16.3` with the tag `test`, you can test using `npm install radium@test`. In retrospect the version should have had `-test` after it too. Fixes FormidableLabs#530
- Loading branch information
1 parent
d8861be
commit 90f353b
Showing
2 changed files
with
23 additions
and
1 deletion.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
const fs = require('fs'); | ||
|
||
const packageJSON = JSON.parse(fs.readFileSync('package.json', 'utf8')); | ||
|
||
const dependencyKeys = Object.keys(packageJSON.dependencies); | ||
dependencyKeys.filter(key => key.startsWith('babel')).forEach(key => { | ||
packageJSON.devDependencies[key] = packageJSON.dependencies[key]; | ||
}); | ||
packageJSON.dependencies = dependencyKeys | ||
.filter(key => !key.startsWith('babel')) | ||
.reduce( | ||
(result, key) => { | ||
result[key] = packageJSON.dependencies[key]; | ||
return result; | ||
}, | ||
{} | ||
); | ||
|
||
fs.writeFileSync('package.json', JSON.stringify(packageJSON, null, ' ') + '\n', 'utf8'); |
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