add live-server
This commit is contained in:
parent
9b4cb16669
commit
02472b601e
4 changed files with 1211 additions and 64 deletions
|
|
@ -46,9 +46,11 @@ Refer to the [documentation page](https://jdan.github.io/98.css/) for specific i
|
||||||
|
|
||||||
### Developing
|
### Developing
|
||||||
|
|
||||||
|
First, run `npm install`.
|
||||||
|
|
||||||
[`style.css`](https://github.com/jdan/98.css/blob/master/style.css) is where everything happens.
|
[`style.css`](https://github.com/jdan/98.css/blob/master/style.css) is where everything happens.
|
||||||
|
|
||||||
You can use `npm start` to start a development environment that will watch for file changes and rebuild 98.css, serving everything on localhost.
|
You can use `npm start` to start a development environment that will watch for file changes and rebuild 98.css, reloading your browser in the process.
|
||||||
|
|
||||||
You can run a build manually with `npm run build`. This will write to the `dist/` directory.
|
You can run a build manually with `npm run build`. This will write to the `dist/` directory.
|
||||||
|
|
||||||
|
|
|
||||||
1253
package-lock.json
generated
1253
package-lock.json
generated
File diff suppressed because it is too large
Load diff
|
|
@ -32,13 +32,13 @@
|
||||||
"gh-pages": "^2.2.0",
|
"gh-pages": "^2.2.0",
|
||||||
"glob": "^7.1.6",
|
"glob": "^7.1.6",
|
||||||
"highlight.js": "^9.18.1",
|
"highlight.js": "^9.18.1",
|
||||||
|
"live-server": "^1.2.1",
|
||||||
"mkdirp": "^1.0.4",
|
"mkdirp": "^1.0.4",
|
||||||
"postcss-calc": "^7.0.2",
|
"postcss-calc": "^7.0.2",
|
||||||
"postcss-copy": "^7.1.0",
|
"postcss-copy": "^7.1.0",
|
||||||
"postcss-css-variables": "^0.14.0",
|
"postcss-css-variables": "^0.14.0",
|
||||||
"postcss-inline": "^1.2.0",
|
"postcss-inline": "^1.2.0",
|
||||||
"postcss-inline-svg": "^4.1.0",
|
"postcss-inline-svg": "^4.1.0"
|
||||||
"serve-handler": "^6.1.2"
|
|
||||||
},
|
},
|
||||||
"dependencies": {}
|
"dependencies": {}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
14
server.js
14
server.js
|
|
@ -1,7 +1,4 @@
|
||||||
const chokidar = require("chokidar");
|
const chokidar = require("chokidar");
|
||||||
const handler = require("serve-handler");
|
|
||||||
const http = require("http");
|
|
||||||
|
|
||||||
const build = require("./build");
|
const build = require("./build");
|
||||||
|
|
||||||
chokidar
|
chokidar
|
||||||
|
|
@ -15,12 +12,5 @@ chokidar
|
||||||
build();
|
build();
|
||||||
});
|
});
|
||||||
|
|
||||||
const server = http.createServer((request, response) => {
|
var liveServer = require("live-server");
|
||||||
return handler(request, response, {
|
liveServer.start({ port: 3000, root: "dist" });
|
||||||
public: "dist",
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
server.listen(3000, () => {
|
|
||||||
console.log("Running at http://localhost:3000");
|
|
||||||
});
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue