|
|
@@ -29,7 +29,8 @@ class CrowiDev {
|
|
|
|
|
|
setupWebpackHMR() {
|
|
|
// Webpack HMR settings
|
|
|
- const webpackConfig = require('../../webpack.config');
|
|
|
+ const configPath = path.join(this.crowi.rootDir, 'webpack.config');
|
|
|
+ const webpackConfig = require(configPath);
|
|
|
var compiler = webpack(webpackConfig);
|
|
|
this.app.use(webpackDevMiddleware(compiler, {
|
|
|
noInfo: true, publicPath: webpackConfig.output.publicPath
|
|
|
@@ -43,7 +44,7 @@ class CrowiDev {
|
|
|
// see: https://github.com/jprichardson/reload
|
|
|
const reloadServer = reload(this.server, this.app);
|
|
|
// fire reload() when views are modified
|
|
|
- const watcher = chokidar.watch(path.join(this.crowi.libDir, 'views'));
|
|
|
+ const watcher = chokidar.watch(path.join(this.crowi.viewsDir));
|
|
|
watcher.on('all', (event, path) => {
|
|
|
reloadServer.reload();
|
|
|
});
|