Skip to content
This repository was archived by the owner on May 29, 2019. It is now read-only.

Load html partials into index.html #18

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,9 @@ After that you will have a ready to deploy bundle at `/dist`
## Contributing

Have a lot of experience with Webpack and suggestions on how we could improve this starter template? We'd love a PR!

## Run on Glitch

1. Open console in Advanced Options.
2. Tailwind needs access to Webpack to work. To allow this, copy the following command into terminal: ```chmod -R u+x node_modules/webpack/bin```. You only need to do this once per session.
3. To start Tailwind: ```npm run dev```.
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
"private": true,
"scripts": {
"dev": "cross-env NODE_ENV=development webpack-dev-server",
"prod": "cross-env NODE_ENV=production webpack --no-progress"
"prod": "cross-env NODE_ENV=production webpack --no-progress",
"start": "node server.js"
},
"devDependencies": {
"cross-env": "^5.1",
Expand All @@ -12,7 +13,7 @@
"postcss": "^6.0.19",
"postcss-loader": "^2.1.1",
"style-loader": "^0.20.3",
"tailwindcss": ">=0.6.5",
"tailwindcss": ">=0.6.6",
"webpack": "^4.1.1",
"webpack-cli": "^2.0.12",
"webpack-dev-server": "^3.1.1"
Expand Down
22 changes: 22 additions & 0 deletions server.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
// server.js
// where your node app starts

// init project
var express = require('express');
var app = express();

// we've started you off with Express,
// but feel free to use whatever libs or frameworks you'd like through `package.json`.

// http://expressjs.com/en/starter/static-files.html
app.use(express.static('src'));

// http://expressjs.com/en/starter/basic-routing.html
app.get("/", function (request, response) {
response.sendFile(__dirname + '/index.html');
});

// listen for requests :)
var listener = app.listen(process.env.PORT, function () {
console.log('Your app is listening on port ' + listener.address().port);
});