Skip to content

Commit 04f6f6b

Browse files
committed
add config option for template watch directory
1 parent cac7d02 commit 04f6f6b

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

vue.config.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ const ManifestPlugin = require('webpack-manifest-plugin')
44
config = {
55
https: false,
66
host: 'localhost',
7-
port: 8080
7+
port: 8080,
8+
watchDir: 'templates'
89
}
910

1011
module.exports = {
@@ -22,7 +23,7 @@ module.exports = {
2223
https: config.https,
2324
before(app, server) {
2425
const sane = require('sane')
25-
var watcher = sane(path.join(__dirname, 'templates'), {glob: ['**/*']});
26+
var watcher = sane(path.join(__dirname, config.watchDir), {glob: ['**/*']});
2627
watcher.on('change', function (filepath, root, stat) {
2728
console.log(' File saved:', filepath);
2829
server.sockWrite(server.sockets, "content-changed");

0 commit comments

Comments
 (0)