Copy files and make @import directives relative to the destination file.
This plugin requires Grunt
If you haven't used Grunt before, be sure to check out the Getting Started guide, as it explains how to create a Gruntfile as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command:
npm install grunt-copy-imports --save-dev
The "copy_imports" task
In your project's Gruntfile, add a section named
copy_imports to the data object passed into
The base path that should be used for all paths defined within
An array of filenames that should be excluded when copying the
@import directives. An object can also be used to exclude imports from specific files. The filename should be used as the property name when defining the list of imports to exclude by file. The
'*' glob can be used to exclude an import from all files. Any duplicate imports will be automatically ignored when the imports are combined.
Include all style rules that come after the
@import directives. The
@imports will be placed above the style rules in the output file, and appear in the order determined by the
The destination file will include all of the
@import directives and style rules by default.
The destination file will exclude any imports with the filename "variables.scss" that are found within any of the files.
The destination file will exclude any imports with the filename "variables.scss" that are found within any of the files. Any style rules within the files and the import directive for "file-to-exclude.scss" found in "_imports-2.scss" will also be excluded.
Feel free to contribute with issues or code.
- 2015-11-03 v0.1.1 - Fix style rules concatenation bug
- 2015-11-02 v0.1.0 - Initial release