- Bootstrap 4 Cookbook
- Ajdin Imsirovic
- 352字
- 2021-07-02 21:08:01
Getting ready
To get ready, we should build on the setup we created in the first recipe, Preparing a static server with Bootstrap 4, Harp and Grunt, in this chapter. However, before we start, there are a few clarifications to be made.
The first thing to note is the one major distinction that the web page that was created in the app folder was still serving the index.html page from the root of that folder. In other words, the app/index.html file and the app/css and the app/js folders can all be thought of as our development environment, whereas the www folder can be thought of as our production environment. Why is that?
To clarify this distinction, we need to remember the end of the previous recipe. At the end of the previous recipe, we have set up the grunt-contrib-watch task as the default task in our custom Gruntfile.js. The watch task was observing our bs4/scss files, including _custom.scss. Any change saved to the bs4/scss/_custom.scss file would lead Grunt to recompile all the SCSS files from the bs4 folder into the app/css/bootstrap.css file. That is why we auto-refreshed our page every X seconds, with the help of that Chrome plugin, because we wanted to be able to live-reload the changes to our app/index.html. However, all of this setup was actually a part of our development environment. If you think about it, this makes perfect sense. It is a way to prototype our website and immediately see the changes.
Now, for our production environment, all we have to do is stop the harp server ./ --port 8080 command and run the harp compile command. The harp compile command will update our www folder, and we will have a newly compiled www folder. This folder is the one that will be pushed to surge.sh. Without stopping the harp server and rerunning e harp compile, the site that we would have pushed to surge.sh would have been the previously compiled www folder.
Now that we have confirmed how everything works, we can push our static website to Surge.
- Python 3.7網絡爬蟲快速入門
- Kali Linux Web Penetration Testing Cookbook
- 軟件界面交互設計基礎
- ASP.NET Core 2 and Vue.js
- HTML5+CSS3網站設計教程
- PySide GUI Application Development(Second Edition)
- PLC編程與調試技術(松下系列)
- INSTANT Sinatra Starter
- Android驅動開發權威指南
- Regression Analysis with Python
- 軟件工程基礎與實訓教程
- Android移動應用項目化教程
- Visual C++從入門到精通(第2版)
- 軟件設計模式(Java版)
- Eclipse開發(學習筆記)