- BREAKING: Require Node.js v18+ (#550, #551)
- BREAKING: Signifigant rewrite, with small behavioral tweaks in a number of edge cases
- Support for
@supports
conditional imports added (#532, #548) - When
skipDuplicates
isfalse
, handles import cycles correctly (#462, #535) - Add
warnOnEmpty
option to allow disabling warnings for empty files (#84, #541) - Use proper
node.error
s (#518, #540)
Huge thanks to @romainmenke
for all the hard work he put into this release.
- Add
data:
URL support (this is not useful for most consumers) (#515)
- Preserve layer in ignored
@import
s (#510, #511) - Join media queries in the correct order (#512, #513)
- BREAKING: Require Node.js v14+ (#497)
- BREAKING: Require
nameLayer
option for handling anonymous layers (#496) - Fix handling of
@media
queries inside layered imports (#495, #496)
- Add
@layer
support (#483)
This release should not have breaking changes for the vast majority of users; only those with @charset
statements in their CSS may be affected.
- BREAKING: Error if multiple incompatible
@charset
statements (#447) - BREAKING: Warn if
@charset
statements are not at the top of files (#447) - Fix handing of
@charset
(#436, #447)
- BREAKING: Require Node 10+ (#429)
- BREAKING: Upgrade to postcss v8 and require it as a
peerDependency
(#427, #432) - Update dependencies
- Removed: Support for Node.js v4
- Changed: Uses PostCSS v7 (https://github.com/postcss/postcss/releases/tag/7.0.0)
- Added:
filter
option
- Changed: A syntax error in an imported file now throws an error instead of just warning (#264)
- Changed: Symlink handling to be consistent with Node.js
require
(#300)
- Removed: Support for Node.js versions less than 4.5.x (#283)
- Changed: Upgraded to Postcss v6 (#283)
- Removed: jspm support (#283)
- Removed: deprecated
addDependencyTo
option - Removed:
onImport
option - Changed: Doesn't depend on promise-each (#281)
- Added:
addModulesDirectories
option (#256)
- Removed:
transform
option (#250) - Removed:
pkg-resolve
is no longer a dependency; this should fix some issues with webpack. jspm users must manually installpkg-resolve
if they want to load jspm modules (see https://github.com/postcss/postcss-import#jspm-usage for more info) (#243) - Changed: If a file is not found, it will now throw an error instead of just raising a warning (#247)
- Changed: If a custom resolver does not return an absolute path, the default resolver will be applied to the returned path. (#249)
- Changed: postcss-import will try to guess the correct parser for imported files, based on the file extension. (#245)
- Changed: Deprecated
addDependencyTo
option, it is not needed if using postcss-loader >= v1.0.0 (#251)
- Fixed: Nested import ordering (#236 - @RyanZim)
- Fixed: prevent JSPM to throw unrecoverable error (#205)
- Fixed: JSPM support (#194)
- Added: JSPM browser field (#186)
- Fixed: Comments between imports statements are ignored (#164)
- Fixed: missing "lib" folder (#161)
All imports statements must be at the top of your file now, per CSS specification.
You should use postcss-reporter to see the warnings raised.
- Removed: async mode/option (now async by default) (#107)
- Removed: "bower_components" not supported by default anymore, use "path" option to add it back
- Removed:
encoding
option. Encoding can be specified in customload
option
postcssImport({
load: function(filename) {
return fs.readFileSync(filename, "utf-8")
}
})
(#144)
- Removed: glob support (#146)
Globs can be implemented with custom resolve
option
postcssImport({
resolve: function(id, base) {
return glob.sync(path.join(base, id))
}
})
(#116)
- Changed: custom resolve has more responsibility for paths resolving. See resolve option for more information about this change (#116)
- Changed: support promise in
transform
option andundefined
result will be skipped (#147) - Changed:
options.plugins
are applied to unprocessed ast before imports detecting (157) - Added: custom resolve function can return array of paths (#120)
- Added: custom syntax in imported files support (#130)
- Added: support custom
load
option (#144) - Added: detect css extension in package.json
main
field (153)
Note: _If you miss options/default behavior (glob etc), a new plugin will handle all those things. Please follow issue #145 _
- Fixed: ensure node 0.12 compatibility, round 2 (#93)
- Fixed: performance issue because of cloned options (#90)
- Added: ensure node 0.12 compatibility
- Removed: compatibility with postcss v4.x (#75)
- Added: compatibility with postcss v5.x (#76)
- Added: lighter package by upgrading some dependencies (#73)
- Added:
skipDuplicates
option now allows you to not skip duplicated files (#67)
- Fixed: Prevent mutability issue, round 2 (#44)
- Added:
plugins
option, to run some postcss plugin on imported files (#55) - Added:
bower_components
is now part of the default paths (#66) - Added:
async
option allow to use enable PostCSS async API usage. Note that it's not enabling async fs read yet. It has been added to fix breaking change introduced by 6.1.0.
This release was not respecting semver and introduced a major breaking change. It has been unpublished for now.
- Changed: warnings messages are now using postcss message api (4.1.x)
- Added: warning when a import statement has not been closed correctly (#42)
- Fixed: globbed imports work for module directories (#37)
- Fixed: glob import now works with single quote
@import
(#36)
- Added: glob pattern are now supported if
glob
option is set to true (#34) - Added: plugin can now be added to PostCSS without calling it as a function (#27)
- Fixed: regression of 5.1.0: files which only contain same @import rules were skip (#31)
- Added: files with the same content will only be imported once. Previously, only the full path was used to determine if a file has already been imported in a given scope.
Now, we also test create a hash with the content of the file to check if a file with the same content has not already been imported.
This might be usefull if some modules you import are importing the same library from different places (eg: normalize might be as dep for several modules located in different places in
node_modules
) (#29)
- Fixed: regression of 5.0.2: AST parent references were not updated (#25)
- Fixed: indentation and code style are now preserved (#20)
- Added: compatibility with postcss v4.x
- Removed: compatibility with postcss v3.x
- Fixed: relative imports (./ and ../) should work using
path
option only (no need forfrom
) (#14)
- Fixed: irregular whitespace that throw syntax error in some environnements
- Added:
web_modules
is now in module directories that are used to resolve@import
(#13).
- Added: windows compatibility (by building on AppVeyor)
- Added:
root
option
- Added:
onImport
callback offers a way to get list of imported files (ref)
- Added: ability to consume local modules (fix #12)
- Added: ability to consume node modules (ref).
This means you don't have to add
node_modules
in the path anymore (or using@import "../node_modules/..."
). Also,index.css
can be ommited.
This means something like this
@import "../node_modules/my-css-on-npm/index.css";
can be written like this
@import "my-css-on-npm";
Dependencies of dependencies should be resolved as well.
Note that npm resolution is done after the default local behavior.
- Changed: When importing a file multiple times in the same scope (same level of media queries), file will only be imported the first time. This is done to avoid having multiples outputs of a npm dep used multiples times in different modules.
- Added: compatibility with postcss v3.x
- Removed: compatibility with postcss v2.x
- Fixed: relative import path stack
- Added: Move ignored import at top & adjust related media queries, to make them work (fix #2)
- Added: Ignore scheme-relative absolute URLs
- Removed:
parse-import
module dependency
- Fixed: GNU message format
- Added: Support empty files (cssnext/#24)
✨ First release based on rework-import v1.2.0 (mainly for fixtures)