Meteor version of react-toolbox-example
meteor npm install && meteor
localhost:3000
in your browsermeteor create your-app
cd your-app
meteor npm install --save react-toolbox
meteor npm install --save-dev node-sass@3.4.2
meteor add nathantreid:css-modules@2.0.2
Remove the server
directory
Remove all files from the client
directory
Download the react-toolbox-example
Copy all of the files from react-toolbox-example/app into the /client folder
Wrap the ReactDom.render()
call in index.jsx inside Meteor.startup()
:
Meteor.startup(function () {
ReactDOM.render((
// rest of ReactDOM.render call...
});
Copy the head & body tags, minus the and (Meteor will handle those) from react-toolbox-example/www/index.html to an index.html in the /client folder
Add the following to packages.json:
"cssModules": {
"extensions": [
"scss"
],
"globalVariables": [
"node_modules/react-toolbox/lib/_colors.scss",
{ "theme-building": true },
"client/toolbox-theme.scss"
]
}
Run meteor
The extensions
property determines which file types are handled by the plugin (default: [ "mss" ]
).
The globalVariables
property is roughly the equivalent of the toolbox-loader configured by toolbox: { theme: }
property from the react-toolbox-example's webpack.config.js.