没有从资产刷新文件Sails.js应用程序启动后, [英] Sails.js application not refreshing files from assets after start

查看:98
本文介绍了没有从资产刷新文件Sails.js应用程序启动后,的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有Angular.JS前端一个Sails.JS应用。
角文件存储在/资产/连接器和他们在开始注入正确。我的问题是,当我改变资产从CSS或js文件的更改不会出现在服务器上,加载的js文件是一样的,当服务器启动。我试着清除浏览器缓存,并在另一个浏览器试过,但还是一样。
我也试过来运行应用永远-w nodemon ,但仍然一无所获。该应用程序在开发模式下,帆反正开始解除--dev 不解决问题也没有。

I have a Sails.JS application with Angular.JS front-end. The angular files are stored in /assets/linker and they are injected properly on start. My issue is that when I change css or js file from assets the change doesn't appear on the server, the loaded js file is the same as when the server started. I tried to clear my browser cache and tried in another browser, but still the same. I also tried to run the application with forever -w and nodemon, but still nothing. The application is in dev mode, anyway starting with sails lift --dev does not solve the issue neither.

我觉得我错过配置的东西。有没有什么办法,迫使资产重装?

I have feeling that I miss something in configuration. Is there any way to force reloading of assets?

推荐答案

您需要检查你的Gruntfile配置。这其中的魔法链接器和livereload的长期发生。

You need to check your Gruntfile configuration. It's where the magic happen in term of linker and livereload.

具体来说,你需要看看任务和相关的任务
默认情况下,它看起来是这样的:

Specifically, you'll need to look at the watch task and the related tasks. By default it looks like this :

watch: {
  api: {

    // API files to watch:
    files: ['api/**/*']
  },
  assets: {

    // Assets to watch:
    files: ['assets/**/*'],

    // When assets are changed:
    tasks: ['compileAssets', 'linkAssets']
  }
}

这篇关于没有从资产刷新文件Sails.js应用程序启动后,的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆