Generator-React-Webpack will help you build new React projects using modern technologies. This is an edited version of generator-react-webpack to serve mbc3 style project components
Please visit: https://github.com/newtriks/generator-react-webpack for more info.
- Generator-React-Webpack-Alt (Adds ability to create actions, stores and sources for alt.js)
- Generator-React-Webpack-Redux (Adds ability to create actions and reducers for Redux)
# Make sure yeomean installed globally
npm install -g yo
pull repo in AppData/Roaming/npm/node_modules
cd into AppData/Roaming/npm/node_modules/generator-react-webpack
npm install
# cd into project
yo react-webpack:component fileName
The above command will create a new component, a package.json and a stylesheet all in the same folder in src/components/fileName
yo react-webpack:component fileName --stateless
Stateless functional components where introduced in React v0.14. They have a much shorter syntax than regular ones and no state or lifecycle methods at all. Please read the React 0.14 release notes to get more information about those components.
Note: You will still be able to set properties for stateless components!
If you have enabled PostCSS at generation time, install your PostCSS plugins via npm and require it in postcss function in cfg/base.js.
Example for autoprefixer:
cd my-new-project
npm install autoprefixer
Require in cfg/base.js
...
postcss: function () {
return [
require('autoprefixer')({
browsers: ['last 2 versions', 'ie >= 8']
})
];
}
...