mirror of
https://github.com/facebook/docusaurus.git
synced 2025-06-14 00:32:47 +02:00
refactor(cssnano-preset): migrate to TS (#7440)
* refactor(cssnano-preset): migrate to TS * fix
This commit is contained in:
parent
c8b5f230ab
commit
71b5901bcd
9 changed files with 76 additions and 43 deletions
27
packages/docusaurus-cssnano-preset/src/index.ts
Normal file
27
packages/docusaurus-cssnano-preset/src/index.ts
Normal file
|
@ -0,0 +1,27 @@
|
|||
/**
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
import advancedBasePreset from 'cssnano-preset-advanced';
|
||||
import postCssSortMediaQueries from 'postcss-sort-media-queries';
|
||||
import postCssRemoveOverriddenCustomProperties from './remove-overridden-custom-properties';
|
||||
|
||||
const preset: typeof advancedBasePreset = function preset(opts) {
|
||||
const advancedPreset = advancedBasePreset({
|
||||
autoprefixer: {add: false},
|
||||
discardComments: {removeAll: true},
|
||||
...opts,
|
||||
});
|
||||
|
||||
advancedPreset.plugins.unshift(
|
||||
[postCssSortMediaQueries, undefined],
|
||||
[postCssRemoveOverriddenCustomProperties, undefined],
|
||||
);
|
||||
|
||||
return advancedPreset;
|
||||
};
|
||||
|
||||
export = preset;
|
Loading…
Add table
Add a link
Reference in a new issue