Extend and join css @import loaded file
npm install grunt-cssjoin~0.4.0
shell
npm install grunt-cssjoin --save-dev
`
One the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:
`js
grunt.loadNpmTasks('grunt-cssjoin');
`
The "cssjoin" task
$3
In your project's Gruntfile, add a section named cssjoin to the data object passed into grunt.initConfig().
`js
grunt.initConfig({
cssjoin: {
production : {
options: {
// Task-specific options go here.
},
your_target: {
// Target-specific file lists and/or options go here.
},
}
},
})
`
$3
#### options.paths
Type: Array or String
Css @import resolve include paths()
$3
#### Default Options
In this example, execute cssjoin to single convert.
`js
grunt.initConfig({
cssjoin: {
join :{
files: {
'dest/bar.css': ['src/bar.css'],
},
}
},
})
`
#### Path Options
In this example, setting cssjoin's paths.
`js
grunt.initConfig({
cssjoin: {
path_option :{
options: {
paths : ["src/"]
},
files: {
'dest/default_options': ['src/foo.css', 'src/dir/bar.css'],
},
}
},
})
`
#### Convert Same File.
In this example, execute cssjoin to same file
`js
grunt.initConfig({
cssjoin: {
sameFile : {
files: grunt.file.expandMapping(["/src/*.css"]),
}
}
})
``