1

我从 Magento 站点安装了 Magento 2。我已经激活了开发者模式

{project directory}>php bin/magento setup:mode:set developer

然后我安装了我的自定义主题,最后我部署了我的静态内容

{project directory}>php bin/magento setup:static-content:deploy

pub/static我的问题是我每次都必须删除目录并部署静态内容才能应用 css 和 javacript 更改。静态内容部署过程很慢,而且要花很多时间,令人非常沮丧。我开发了一些东西,并且必须进行部署才能使更改出现。即使是很小的变化。刷新缓存没有帮助。任何帮助,将不胜感激。提前致谢。

4

1 回答 1

0

当您更改 css 时,grunt 作业应该足以运行。

所以你可以运行:

grunt exec
grunt less

或指定主题名称:

grunt exec:theme_name
grunt less:theme_name

签入core_config_data表中的数据库并禁用缩小字段,以便 Magento 在开发时不会缩小 css / js。您可以使用此 SQL 查询来禁用这些字段:

update core_config_data set value=0 where path in ('dev/css/minify_files', 'dev/css/merge_css_files', 'dev/js/minify_files', 'dev/js/merge_files')
于 2016-08-04T12:39:50.377 回答