Skip to content

Commit

Permalink
[build] Keep a single build:min script
Browse files Browse the repository at this point in the history
  • Loading branch information
oliviertassinari committed Dec 18, 2016
1 parent 0db2aca commit 8b80668
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 12 deletions.
13 changes: 3 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,22 +76,15 @@ on how to do so.

### Packaging for use with separate React

For using with React and React DOM from a CDN or as separate minified scripts, you can build
files with UMD module support as follows:
For using with React and React DOM from a CDN or as separate minified scripts,
you can build files with UMD module support as follows:

```sh
npm install
npm run build:umd
npm run build:min
```

This will build two archives into the /dist folder

To see what's going on under the hood, you can use webpack directly:

```sh
webpack --display-reasons --display-modules --progress --optimize-minimize --colors --entry ./src/index.js
```
This will build one `material-ui.min.js` file into the `/dist` folder.

## Usage

Expand Down
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,10 @@
},
"homepage": "http://material-ui.com/",
"scripts": {
"build": "npm run build:babel && npm run build:copy-files && npm run build:umd && npm run build:min",
"build": "npm run build:babel && npm run build:copy-files && npm run build:min",
"build:icon-index": "babel-node ./scripts/icon-index-generator.js",
"build:babel": "babel ./src --ignore *.spec.js --out-dir ./build",
"build:copy-files": "babel-node ./scripts/copy-files.js",
"build:umd": "cross-env NODE_ENV=development webpack src/index.js --output-filename material-ui.js",
"build:min": "cross-env NODE_ENV=production webpack -p src/index.js --output-filename material-ui.min.js",
"build:docs": "babel-node ./scripts/build-api-docs.js",
"clean": "npm run clean:build",
Expand Down

4 comments on commit 8b80668

@nealeu
Copy link
Contributor

@nealeu nealeu commented on 8b80668 Dec 18, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi,

I'm not so sure about removing a development version.

I'm as much in need of a development build as the minified one for production. I think taking it out of the default build to avoid CI building it would be fine though.

@oliviertassinari
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm as much in need of a development build

What's your use case for it? I couldn't think about a valid one, but a I could be wrong.

@nealeu
Copy link
Contributor

@nealeu nealeu commented on 8b80668 Dec 18, 2016 via email

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@oliviertassinari
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see, thanks for the motivation.

I think taking it out of the default build to avoid CI building it would be fine though.

That sounds good to me 👍 .

Please sign in to comment.