ShareCourse Outline

Build an App with React and Ampersand

1-5 Setting up webpack

next:Introducing React
previous:Deploying with Surge


modules installed

To minimize issues that may be caused by changes in future releases, you can run the following command to install the specific versions used at the time of recording:

npm i --save autoprefixer-stylus@0.5.0 babel@5.1.13 babel-core@5.1.13 babel-loader@5.0.0 css-loader@0.12.0 file-loader@0.8.1 hjs-webpack@2.0.1 react@0.13.2 react-hot-loader@1.2.5 style-loader@0.12.1 stylus-loader@1.1.0 url-loader@0.5.5 webpack@1.8.11 webpack-dev-server@1.8.2 yeticss@6.0.5 hjs-webpack@2.0.1

if using windows

The way environment variables are set works somewhat differently, so does the way you remove and create directories.

Your build and prebuild scripts in your package.json will likely need to be modified to be:

"prebuild": "rmdir /Q /S public && mkdir public",
"build": "set NODE_ENV=production&& webpack"

Or in powershell the remove dir can be done with: Remove-Item -Recurse -Force public

Please let me know if you have issues with anything like this on windows so I can document it for it others.

commands used

npm i --save hjs-webpack
npm run build
npm run start
npm run yolo

other notes

Code Viewer