This repository has been archived by the owner on Jan 9, 2023. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 184
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(css): add tsdx config for PostCSS, organize CSS and SASS imports
- Loading branch information
1 parent
4094600
commit add82bf
Showing
6 changed files
with
32 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
tsdx.config.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
const postcss = require('rollup-plugin-postcss') | ||
const autoprefixer = require('autoprefixer') | ||
const cssnano = require('cssnano') | ||
|
||
module.exports = { | ||
rollup(config, options) { | ||
config.plugins.push( | ||
postcss({ | ||
plugins: [ | ||
autoprefixer(), | ||
cssnano({ | ||
preset: 'default', | ||
}), | ||
], | ||
inject: false, | ||
// only write out CSS for the first bundle (avoids pointless extra files): | ||
extract: !!options.writeMeta, | ||
modules: true, | ||
}), | ||
) | ||
return config | ||
}, | ||
} |