I've followed the getting started guide and have the example running, but it seems to load all of the js components from the example lib folder as separate resources. How do I get it to build a single material-ui.js (or material-ui.min.js) file which I just reference from my html? Do I use npm, gulp, browserify, etc? If so, how? I am not at all familiar with the javascript build and packaging tools. I just want a single js file to include in my static resources, like react.min.js
相关问题
- Is there a limit to how many levels you can nest i
- How to toggle on Order in ReactJS
- void before promise syntax
- Keeping track of variable instances
- Can php detect if javascript is on or not?
you have to follow the guids
First go to example folder
Run this
It will install all required packages described in package.json
Then
It will run web server
And finally just run gulp
It will run all gulp tasks described here
browserify-gulp-example/gulp/tasks
In result you will come with file app.js in build folder
You can include it in your html as usually
Now you can run http://localhost:3000 and check for result
You're probably using babel to transform your inline jsx (ie. following the React tutorial), so you can use the es6 import syntax:
The whole script block is: