magento中的Grunt没有编译文件

时间:2018-04-18 12:53:41

标签: docker magento gruntjs

我的本​​地安装(docker)magento有问题。 我尝试进行一些css更改,遗憾的是grunt.js无法编译我的文件。启动“grunt watch”命令后,控制台显示“Waiting ...”但不更新任何文件。请帮助:)

2 个答案:

答案 0 :(得分:0)

@btek 是的,我添加了主题。 Grunt exec命令返回警告:

grunt exec:xx --force
Running "exec:xx" (exec) task
Running "clean:xx" (clean) task
>> 7 paths cleaned.

Done.


Execution Time (2018-04-19 08:12:01 UTC)
loading tasks                98ms  ▇▇▇▇▇▇▇▇▇▇▇▇▇ 37%
loading grunt-contrib-clean  76ms  ▇▇▇▇▇▇▇▇▇▇ 29%
clean:xx                    90ms  ▇▇▇▇▇▇▇▇▇▇▇▇ 34%
Total 265ms

Magento supports 7.0.2, 7.0.4, and 7.0.6 or later. Please read http://devdocs.magento.com/guides/v1.0/install-gde/system-requirements.html>> Exited with code: 1.
>> Error executing child process: Error: Process exited with code 1.
Warning: Task "exec:xx" failed. Used --force, continuing.

Done, but with warnings.


Execution Time (2018-04-19 08:11:57 UTC)
loading tasks       758ms  ▇▇▇▇▇▇▇▇ 17%
loading grunt-exec   47ms  ▇ 1%
exec:xx             3.6s  ▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇ 82%
Total 4.4s

少哼哼:

grunt less:xx
Running "less:xx" (less) task
>> Destination pub/static/frontend/xx/css/styles-m.css not written because no source files were found.
>> Destination pub/static/frontend/xx/css/styles-l.css not written because no source files were found.

Done.


Execution Time (2018-04-19 08:45:14 UTC)
loading tasks               81ms  ▇▇▇ 7%
loading grunt-contrib-less  1.1s  ▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇ 92%
less:xx                    12ms  ▇ 1%
Total 1.2s

监视模式下的Grunt不会更新我的css文件:(

答案 1 :(得分:0)

@btek肯定!

/**
 * Copyright © Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */

'use strict';

/**
 * Define Themes
 *
 * area: area, one of (frontend|adminhtml|doc),
 * name: theme name in format Vendor/theme-name,
 * locale: locale,
 * files: [
 * 'css/styles-m',
 * 'css/styles-l'
 * ],
 * dsl: dynamic stylesheet language (less|sass)
 *
 */
module.exports = {
    blank: {
        area: 'frontend',
        name: 'Magento/blank',
        locale: 'en_US',
        files: [
            'css/styles-m',
            'css/styles-l',
            'css/email',
            'css/email-inline'
        ],
        dsl: 'less'
    },
    luma: {
        area: 'frontend',
        name: 'Magento/luma',
        locale: 'en_US',
        files: [
            'css/styles-m',
            'css/styles-l'
        ],
        dsl: 'less'
    },
    backend: {
        area: 'adminhtml',
        name: 'Magento/backend',
        locale: 'en_US',
        files: [
            'css/styles-old',
            'css/styles'
        ],
        dsl: 'less'
    },
    theme: {
        area: 'frontend',
        name: 'vendor/theme',
        locale: 'de_DE',
        files: [
            'css/styles-m',
            'css/styles-l'
        ],
        dsl: 'less'
    }
};