GithubHelp home page GithubHelp logo

Comments (11)

kokarn avatar kokarn commented on July 22, 2024

Sorry, forgot to answer.

Can you post your gruntfile so we can have a look at that?

from atom-grunt-runner.

maxiz avatar maxiz commented on July 22, 2024

Here's the gruntfile. Some file paths have been removed for simplicity.

module.exports = function (grunt) {
    'use strict';
    grunt.initConfig({
        pkg: grunt.file.readJSON('package.json'),      
        notify_hooks: {
            options: {
                enabled: true,
                max_jshint_notifications: 5,
                success: true, 
                duration: 3
            }
        },
        ts: {            
            options: {
                target: 'es5',
                module: 'amd',
                sourceMap: true,
                declaration: false,
                nolib: false,
                comments: false,
                compress: true,
                report: true,
            },
            dev: {
                files: [{ src: ['Scripts/**/*.ts', '!Scripts/**/*.d.ts'] }],
                expand: true,
                options: {
                    sourceMap: true,
                    title: 'Typescript',
                    message: 'Compilation completed'
                }
            }
        },
        sprite: {
            all: {
                algorithm: 'binary-tree',
                dest: 'Images/dest.png',
                destCss: 'Styles/dest.png.less',
                src: ['Images/*.png']
            },
            xref: {
                algorithm: 'binary-tree',
                dest: 'Images/dest.png',
                destCss: 'Styles/dest.png.less',
                cssFormat: 'less',
                src: [ /* Files removed */]
            }
        },
        less: {
            dev: {
                options: {
                    compress: true,
                    optimization: 2,
                    relativeUrls: true,
                },
                files: [{
                    expand: true,
                    cwd: 'Styles/',
                    src: ['**/*.less'],
                    ext: '.css',
                    dest: 'Styles/'
                }]
            }
        },
        cssmin: {
            allstyles: {
                options: {                    
                    noRebase: true
                },
                files: [{
                    expand: true,
                    cwd: 'Styles',
                    src: ['**/*.css', '!**/*.min.css'],
                    dest: 'Styles/',
                    ext: '.min.css'
                }]
            },
            bundle: {
                options: {
                    noRebase: true,
                },
                files: {
                    'Styles/bundles/commonbundle.min.css': 'Styles/bundles/commonbundle.css'
                }
            }
        },
        uglify: {
            options: {
                compress: false,
                mangle: true,
                sourceMap: true,
                report: true,
                unused: false
            },
            applib: {
                options: {
                    unused: false
                },
                files: [{
                    expand: true,
                    cwd: 'Scripts/',
                    src: ['**/*.js', '!**/*.min.js'],
                    dest: 'Scripts/',
                    ext: '.min.js'
                }]
            },
            combine: {
                options: {
                    unused: false
                },
                files: [{
                    expand: true,
                    cwd: 'Scripts/bundles',
                    src: ['*.js', '!*.min.js'],
                    dest: 'Scripts/bundles/',
                    ext: '.min.js'
                }]
            }
        },
        concat: {
            options: {
                title: 'Concat',
                message: 'Concatination completed'
            },
            styles: {
                files: {
                    'Styles/bundles/commonbundle.css': [/* File paths */]                    
                }
            },
            scripts: {
                options: {
                    separator: ';\n'
                },
                files: {
                    'Scripts/bundles/commonscripts.js': [/* File paths */]                    
                }
            }
        },        
        exec: {
            options: {
                title: 'Publish Completed',
                message: 'Published files successfully'
            },
            publish: {
                cmd: '"C:\\Program Files\\SyncToy 2.1\\SyncToyCmd.exe" -R dest',
                stdout: true,
                stderr: false,
                options: {
                    title: 'Publish Completed',
                    message: 'Published files successfully'
                }
            }            
        },
        watch: {
            scripts: {
                files: ['Scripts/**/*.ts', '!Scripts/**/*.d.ts'],
                tasks: ['ts', 'concat:scripts', 'exec:publish'],
                options: {
                    nospawn: true,
                }
            },
            styles: {
                files: ['Styles/**/*.less'],
                tasks: ['less', 'concat:styles', 'cssmin:bundle', 'exec:publish'],
                options: {
                    nospawn: true
                }
            },
            htmls: {
                files: ['**/*.aspx', '**/*.ascx', '**/*.master', '**/*.html'],
                tasks: ['exec:publish'],
                options: {
                    nospawn: true
                }
            },
            grunt: {
                files: ['Gruntfile.js']
            }
        },
    });

    require("load-grunt-tasks")(grunt, { pattern: ['grunt-*'] });    
    grunt.registerTask('default', ['watch']);
    grunt.registerTask('compileStyles', ['less', 'concat:styles', 'cssmin:bundle']);
    grunt.registerTask('compileScripts', ['ts:dev', 'concat:scripts']);
    grunt.registerTask('publish', ['ts:dev', 'less', 'concat', 'cssmin:bundle', 'exec:publish']);
    grunt.registerTask('publishScripts', ['ts:dev', 'concat:scripts', 'exec:publish']);
    grunt.registerTask('publishStyles', ['less', 'concat:styles', 'cssmin:bundle', 'exec:publish']);
    grunt.registerTask('prod', ['ts:dev', 'less', 'cssmin:allstyles', 'uglify:applib', 'concat', 'cssmin:bundle']);
    grunt.registerTask('createsprites', ['sprite:all']);
    grunt.registerTask("copyOnly", ['exec:publish']);

};

Thanks,

from atom-grunt-runner.

kokarn avatar kokarn commented on July 22, 2024

Could you try with the latest version from master and see if that fixes the issue?

from atom-grunt-runner.

maximegris avatar maximegris commented on July 22, 2024

Did you install "grunt-cli" package on nodejs ? => npm install -g grunt-cli
You need it to start the runner.

from atom-grunt-runner.

maxiz avatar maxiz commented on July 22, 2024

@maximegris - Yes, I had installed grunt-cli globally. The package worked with a simple gruntfile but was having trouble with the gruntfile I posted above.

@kokarn - Thanks for the update. I'll update the package and see if it works.

from atom-grunt-runner.

kokarn avatar kokarn commented on July 22, 2024

We had some problems with mocha making grunt unable to run. Would you mind commenting out one task at a time to see if you can narrow it down?

from atom-grunt-runner.

NKjoep avatar NKjoep commented on July 22, 2024

I have the same problem and I'd like to help. Do you need any log?
I'm running node 4 with windows 7 x64

from atom-grunt-runner.

kokarn avatar kokarn commented on July 22, 2024

@maxiz @NKjoep Did you get this to work?

from atom-grunt-runner.

NKjoep avatar NKjoep commented on July 22, 2024

@kokarn Honestly, I gave up and continued with my standard CLI.

should I try again? :)

from atom-grunt-runner.

kokarn avatar kokarn commented on July 22, 2024

Sure! Any input is appreciated. Quite a few updates to the package since you had trouble with it.

from atom-grunt-runner.

yhormanp avatar yhormanp commented on July 22, 2024

This is what I did based on what I read on this post to solve the issue. Hope this works for anyone else.

I had the same issue with "Grunt exited with code 1.". But after read this post I uninstalled
-Grunt-runner
-build (atom-build)

through cmd installed ----- npm install -g grunt-cli
installed again Grunt-runner

and now it's working fine with any of the grunt file that I have in several projects.

from atom-grunt-runner.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.