如何使用grunt在开发和生产环境中使tinymce正常工作?

5

我是grunt和bower软件包管理的初学者。我的应用程序中使用了tinymce包。当我使用grunt serve时,一切正常,但当我使用grunt serve:dist时,浏览器在错误的路径中搜索tinymce插件,而Chrome和Mozilla可以找到插件。

我想也许我需要将tinymce的插件URL指向相关路径,但与theme_url等属性不同,这似乎不可能。

我该怎么办?我不想将整个tinymce复制到dist目录下。

1个回答

2
在Gruntfile.js中。
// Copies remaining files to places other tasks can use
copy: {
            dist: {
                files: [{
                    expand: true,
                    dot: true,
                    cwd: '<%= yeoman.app %>',
                    dest: '<%= yeoman.dist %>',
                    src: [
                        '*.{ico,png,txt}',
                        '.htaccess',
                        '*.html',
                        'modules/**/*.html',
                        'images/{,*/}*.*',
                        'styles/fonts/{,*/}*.*'
                    ]
                }, {
                    expand: true,
                    cwd: '.tmp/images',
                    dest: '<%= yeoman.dist %>/images',
                    src: ['generated/*']
                }, {
                    expand: true,
                    cwd: 'bower_components/bootstrap-sass-official/assets/fonts/bootstrap/',
                    src: '*',
                    dest: '<%= yeoman.dist %>/fonts'
                }, {
                    expand: true,
                    cwd: 'bower_components/tinymce-dist/themes/modern/',
                    src: ['**'],
                    dest: '<%= yeoman.dist %>/core/themes/modern/'
                }, {       
                    expand: true,
                    cwd: 'bower_components/tinymce-dist/skins/',
                    src: ['**'],
                    dest: '<%= yeoman.dist %>/core/skins/'
                }, {
                    expand: true,
                    cwd: 'bower_components/tinymce-dist/plugins/link/',
                    src: ['**'],
                    dest: '<%= yeoman.dist %>/core/plugins/link/'
                }, {
                    expand: true,
                    cwd: 'bower_components/font-awesome/fonts/',
                    src: '*',
                    dest: '<%= yeoman.dist %>/fonts'
                }]
            },
            styles: {
                expand: true,
                cwd: '<%= yeoman.app %>/modules',
                dest: '.tmp/styles/',
                src: '{,*/}*.css'
            }
        },

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接