mirror of
https://github.com/kognise/water.css.git
synced 2026-01-09 23:05:45 +01:00
Fix script
This commit is contained in:
parent
2b900b7e66
commit
a176146843
3 changed files with 17 additions and 2 deletions
14
dev.js
14
dev.js
|
|
@ -18,6 +18,13 @@ app.get('/', async (req, res) => {
|
|||
res.send(injected)
|
||||
})
|
||||
|
||||
app.get('/script.js', async (req, res) => {
|
||||
console.log('> Serving script')
|
||||
const script = await fs.readFile('script.js')
|
||||
res.contentType('javascript')
|
||||
res.send(script)
|
||||
})
|
||||
|
||||
app.use('/dist', (req, res, next) => {
|
||||
console.log('> Serving a stylesheet')
|
||||
next()
|
||||
|
|
@ -33,7 +40,12 @@ chokidar.watch('index.html', { ignoreInitial: true }).on('all', () => {
|
|||
reload()
|
||||
})
|
||||
|
||||
chokidar.watch('src/*.scss', { ignoreInitial: true }).on('all', async (event, file) => {
|
||||
chokidar.watch('script.js', { ignoreInitial: true }).on('all', () => {
|
||||
console.log('> Script changed')
|
||||
reload()
|
||||
})
|
||||
|
||||
chokidar.watch('src/*.scss', { ignoreInitial: true }).on('all', (event, file) => {
|
||||
console.log('> Stylesheet changed')
|
||||
sass.render({ file, outputStyle: 'compressed' }, async (errors, { css }) => {
|
||||
if (errors) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue