You've already forked 98.css
mirror of
https://github.com/jdan/98.css.git
synced 2026-05-05 06:01:22 +09:00
add live-server
This commit is contained in:
@@ -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");
|
|
||||||
});
|
|
||||||
|
|||||||
Reference in New Issue
Block a user