- Clone to your machine.
- Install dependencies with
npm install. - Start the development server with
npm start. - Open
localhost:3039. - To publish a build to the gh-pages branch, use
npm run publish. This creates a fresh build in the dist folder and then pushes it to the master branch. DO NOT PUSH TO MASTER. THEnpmCOMMAND WILL DO THAT FOR YOU.
To add a page, create an html file in the src directory and a script in the src/js directory. In the script, import the page's SASS stylesheet.
import '../sass/page.scss';Then add the script as a chunk to webpack.config.js.
entry: {
...
page: './src/js/page.js'
},Now add an instance of HtmlWebpackPlugin to the plugins array in the webpack config.
plugins: [
...
new HtmlWebpackPlugin({
template: './src/page.html',
filename: 'page/index.html',
chunks: ['page']
}),
...
],Restart your devServer if it's already running and you should see your page at http://localhost:3039/page.
- Here's where I got the hack for maintaining the aspect ratio for the Youtube iframes.
- Querystring parser used in
workshop.js.