12 Commits

Author SHA1 Message Date
Colt Steele
991f703d05 Minify JS, CSS, and HTML in production
- Extracted CSS into own file in production
- Minified CSS in production
- Added TerserJS back in to minify JS in production
- Minified HTML in production as well
2019-03-05 21:02:05 -08:00
Colt Steele
34e7d30aef Add entrypoint for vendor js file, add bootstrap js
- Now we have 2 entry files and 2 bundles
- The vendor file houses code that is less likely to change, 3rd party libraries
- The main file has all of our app code
2019-03-05 18:37:07 -08:00
Colt Steele
947290016d Add html-loader, file-loader, and clean-webpack-plugin
- Added html-loader to automatically require the files we reference in img tags
- Added file-loader to handle the svg,png,jpg,gif files from our images
- Configured file-loader to add our images to an imgs directory in dist
- Also configured it to add a hash to their filenames
- Lastly, added clean-webpack-plugin to our production config to clean out the dist directory each time we build
2019-03-05 18:13:21 -08:00
Colt Steele
eb66c0dc93 Add prod and dev configs, dev-server
- Broke our webpack.config file into 3 files
- webpack.common.js, webpack.dev.js, and webpack.prod.js
- installed webpack-merge to share the common functionality
- updated our package.json to use the new config files
- installed webpack-dev-server and added it to start script in package.json
2019-03-05 17:24:01 -08:00
Colt Steele
c932911657 Cache busting and HtmlWebpackPlugin
- Configured webpack to use contentHash in bundle file name
- This caused a problem with out script tag in index.html
- We installed HtmlWebpackPlugin to help us generate a new index.html
- It automatically includes the correct script tag at the bottom
- We created a template file that we passed in called template.html
- We deleted the original index.html because we don't need it anymore
- Make sure you are opening dist/index.html now to view the app
2019-03-05 15:24:55 -08:00
Colt Steele
21c9e3b623 Add Sass loader, override bootstrap colors
- Changed our main.css to main.scss
- Installed bootstrap locally so we can tweak it
- Installed sass-loader and node-sass
- Updated webpack.config file to include a .scss rule
2019-03-05 15:00:12 -08:00
Colt Steele
65c2ac4709 Add first loaders to handle css
- Installed style-loader and css-loader
- Configured webpack.config to use both loaders on css files
- Remember the order we use them in webpack.config matters
2019-03-05 14:50:31 -08:00
Colt Steele
d13f75ab6c Add webpack config file
- Created webpack.config.js
- Added some basic configuration
- Modified package.json, so that webpack uses our config file
2019-03-05 11:48:38 -08:00
Colt Steele
2b11dd3624 Webpack now bundling all our app code
- We use import/export to indicate dependencies
- Webpack makes sure everything loads in the correct order
- We can remove all our additional script tags in index.html
2019-03-05 11:18:36 -08:00
Colt Steele
2400d188ea Installed webpack
- Installed webpack and webpack-cli
- Added a start script in package.json which calls webpack
- Made an index.js file, which is the file webpack looks for by default
- Webpack spits out our code in dist/main.js by default
- Currently our main app code has nothing to do with webpack, but it will soon
2019-03-04 23:09:36 -08:00
Colt Steele
dd54924933 Break code into separate scripts, no webpack
- Broke up app.js into 5 scripts
- We have to manually include each script in index.html
- We have to pay attention to the order they load in
2019-03-04 23:00:28 -08:00
Colt Steele
b96a9dbce0 Initial app code, no webpack
- Pre-webpack version of our simple app
- One app.js file with all the code
- Bootstrap included via CDS, no SASS or customization
- Single SVG included in assets folder
2019-03-04 22:51:35 -08:00