The original readme can be found here.
Fill out the <> entries according to your needs:
- Clone this repo into a static folder in your django project by executing
git clone git@github.com:Innoactive/react-slingshot.git <folder-name> - Change into the newly cloned directory by running
cd <folder-name>and runnpm run setup - Modify Django's
settings.pylike this:
WEBPACK_LOADER = {
'<name>': {
'BUNDLE_DIR_NAME': '<folder-name>/dist/',
'STATS_FILE': os.path.join(BASE_DIR, '<static-folder-path>/<folder-name>/webpack-stats.json')
}
}The WEBPACK_LOADER config can contain multiple configs.
Assuming you are in the src/assets/static folder, and you clone the repo into a folder called test, the config will look like this:
WEBPACK_LOADER = {
'test': {
'BUNDLE_DIR_NAME': 'test/dist/',
'STATS_FILE': os.path.join(BASE_DIR, 'assets/static/test/webpack-stats.json')
}
}NOTE: you need to run npm install once
While developing just start the dev server by executing npm start -s
NOTE: you need to run npm install once
Run the following command: npm run build
