Skip to content

Commit

Permalink
[Icons] Modernize icons package (#7203)
Browse files Browse the repository at this point in the history
* [Icons] Modernize icons package

* Use root babel config
  • Loading branch information
kvet authored and oliviertassinari committed Jun 23, 2017
1 parent 789dc3b commit 0eda6de
Show file tree
Hide file tree
Showing 5 changed files with 1,024 additions and 1,353 deletions.
2 changes: 1 addition & 1 deletion packages/material-ui-icons/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ function processIndex(options) {
const results = [];
files.forEach(jsPath => {
const typename = path.basename(jsPath).replace('.js', '');
results.push(`export { ${typename} } from './${typename}';\n`);
results.push(`export { default as ${typename} } from './${typename}';\n`);
});
const index = results.join('');
const absDestPath = path.join(options.outputDir, 'index.js');
Expand Down
3 changes: 3 additions & 0 deletions packages/material-ui-icons/copy-files.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ function createPackageFile() {
author,
version,
description,
main: './index.js',
module: './index.es.js',
'jsnext:main': './index.es.js',
keywords,
repository,
license,
Expand Down
8 changes: 4 additions & 4 deletions packages/material-ui-icons/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,9 @@
"react-component"
],
"scripts": {
"build": "npm run build:icons && npm run build:babel && npm run build:copy-files",
"build:babel": "babel --presets es2015,react -d ./build ./src",
"build": "npm run build:icons && npm run build:es2015 && npm run build:es2015modules && npm run build:copy-files",
"build:es2015": "cross-env NODE_ENV=production babel ./src --out-dir ./build",
"build:es2015modules": "cross-env NODE_ENV=production BABEL_ENV=modules babel ./src/index.js --out-file ./build/index.es.js",
"build:copy-files": "babel-node ./copy-files.js",
"build:icons": "babel-node ./build.js --output-dir ./src --svg-dir ./node_modules/material-design-icons --glob '/**/production/*_24px.svg' --renameFilter ./filters/rename/material-design-icons.js",
"clean": "rimraf build",
Expand All @@ -33,9 +34,8 @@
},
"devDependencies": {
"babel-cli": "^6.24.1",
"babel-preset-es2015": "^6.24.1",
"babel-preset-react": "^6.24.1",
"chai": "^3.0.0",
"cross-env": "^5.0.1",
"fs-extra": "^2.0.0",
"glob": "^7.0.0",
"lodash": "^4.0.0",
Expand Down
Loading

0 comments on commit 0eda6de

Please sign in to comment.