简体   繁体   中英

This Gruntfile is outputting a file called “dest” instead of a css file in the path I've supplied. Why?

This Gruntfile is outputting a file called "dest" in the root of my project, instead of a css file in assets/css. Why?

 module.exports = function(grunt) { grunt.initConfig({ pure_grids: { dest : 'assets/css/main-grid.css', options: { units: 12, // 12-column grid mediaQueries: { sm: 'screen and (min-width: 35.5em)', // 568px md: 'screen and (min-width: 48em)', // 768px lg: 'screen and (min-width: 64em)', // 1024px xl: 'screen and (min-width: 80em)' // 1280px } } } }); grunt.loadNpmTasks('grunt-pure-grids'); // Default task(s). grunt.registerTask('default', ['pure_grids']); } 

The grunt-pure-grids plugin is a Multi-task plugin , you may need to update your config and wrap the settings you've defined within a target . The example below wraps your settings within a target called foo :

grunt.initConfig({
    pure_grids: {
        foo: {
            dest : 'assets/css/main-grid.css',

            options: {
                units: 12, // 12-column grid

                mediaQueries: {
                    sm: 'screen and (min-width: 35.5em)', // 568px
                    md: 'screen and (min-width: 48em)',   // 768px
                    lg: 'screen and (min-width: 64em)',   // 1024px
                    xl: 'screen and (min-width: 80em)'    // 1280px
                }
            }
        }
    }
});

If that doesn't work, you may need to file an issue with the grunt plugin's owner, but be aware that grunt-pure-grids hasn't been updated in 2 years, it may now be orphaned.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM