@empjs/plugin-postcss 3.0.0-rc.1 → 3.0.0-rc.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +2 -2
- package/dist/index.js +5 -4
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { GlobalStore } from '@empjs/cli';
|
|
2
2
|
export type PluginPostcssType = {
|
|
3
|
-
postcssOptions
|
|
3
|
+
postcssOptions?: any;
|
|
4
4
|
};
|
|
5
|
-
declare const _default: (o
|
|
5
|
+
declare const _default: (o?: PluginPostcssType) => {
|
|
6
6
|
name: string;
|
|
7
7
|
rsConfig(store: GlobalStore): Promise<void>;
|
|
8
8
|
};
|
package/dist/index.js
CHANGED
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
import { plugins } from './plugins.js';
|
|
2
2
|
//
|
|
3
|
-
export default (o) => {
|
|
3
|
+
export default (o = {}) => {
|
|
4
4
|
return {
|
|
5
5
|
name: '@empjs/plugin-postcss',
|
|
6
6
|
async rsConfig(store) {
|
|
7
7
|
const { chain, importResolve } = store;
|
|
8
8
|
//
|
|
9
9
|
const ruleMap = ['sass', 'less', 'css'];
|
|
10
|
-
const loaderOptions = {
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
const loaderOptions = {};
|
|
11
|
+
if (o.postcssOptions) {
|
|
12
|
+
loaderOptions.postcssOptions = o.postcssOptions;
|
|
13
|
+
}
|
|
13
14
|
for (const ruleName of ruleMap) {
|
|
14
15
|
const rule = chain.module.rule(ruleName);
|
|
15
16
|
const useLightningcss = rule
|