@mekari/pixel3-postcss 0.0.7-dev.0 → 0.0.7-dev.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.js +11 -5
- package/dist/index.mjs +11 -5
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -122,17 +122,23 @@ function mergeConfig(obj1, obj2) {
|
|
|
122
122
|
return { ...obj1, ...tempObj };
|
|
123
123
|
}
|
|
124
124
|
var createConfigFile = (filePath, options, packageManager) => {
|
|
125
|
-
const
|
|
125
|
+
const _defaultConfig = { ...defaultConfig2 };
|
|
126
126
|
if (packageManager) {
|
|
127
127
|
const pixelDir = path.dirname(findRealModulePath("@mekari/pixel3"));
|
|
128
|
-
|
|
128
|
+
const extend = `${pixelDir}/**/dist/**/*.{js,mjs}`;
|
|
129
|
+
const finalInclude = [..._defaultConfig.include, extend];
|
|
130
|
+
_defaultConfig.include = finalInclude;
|
|
129
131
|
}
|
|
130
|
-
const configs = mergeConfig(
|
|
132
|
+
const configs = mergeConfig(_defaultConfig, options);
|
|
131
133
|
const data = "export default" + JSON.stringify(configs, null, 2);
|
|
132
134
|
try {
|
|
133
135
|
fs.writeFileSync(filePath, data, "utf-8");
|
|
134
136
|
} catch (error) {
|
|
135
|
-
|
|
137
|
+
if (error instanceof Error) {
|
|
138
|
+
console.error(error.message);
|
|
139
|
+
} else {
|
|
140
|
+
console.error("An unknown error occurred");
|
|
141
|
+
}
|
|
136
142
|
}
|
|
137
143
|
};
|
|
138
144
|
|
|
@@ -177,7 +183,7 @@ var pixelcss = (options = {}) => {
|
|
|
177
183
|
const { cwd } = options;
|
|
178
184
|
const packageManager = getPackageManager();
|
|
179
185
|
createConfigFile(configPath, options, packageManager);
|
|
180
|
-
console.log("Using package manager", packageManager);
|
|
186
|
+
console.log("Using package manager: ", packageManager);
|
|
181
187
|
console.log("Pixel Config (auto-generated) :", configPath);
|
|
182
188
|
return {
|
|
183
189
|
postcssPlugin: PLUGIN_NAME,
|
package/dist/index.mjs
CHANGED
|
@@ -114,17 +114,23 @@ var init_create_config = __esm({
|
|
|
114
114
|
path = __require("path");
|
|
115
115
|
({ defaultConfig: defaultConfig2 } = (init_default_config(), __toCommonJS(default_config_exports)));
|
|
116
116
|
createConfigFile = (filePath, options, packageManager) => {
|
|
117
|
-
const
|
|
117
|
+
const _defaultConfig = { ...defaultConfig2 };
|
|
118
118
|
if (packageManager) {
|
|
119
119
|
const pixelDir = path.dirname(findRealModulePath("@mekari/pixel3"));
|
|
120
|
-
|
|
120
|
+
const extend = `${pixelDir}/**/dist/**/*.{js,mjs}`;
|
|
121
|
+
const finalInclude = [..._defaultConfig.include, extend];
|
|
122
|
+
_defaultConfig.include = finalInclude;
|
|
121
123
|
}
|
|
122
|
-
const configs = mergeConfig(
|
|
124
|
+
const configs = mergeConfig(_defaultConfig, options);
|
|
123
125
|
const data = "export default" + JSON.stringify(configs, null, 2);
|
|
124
126
|
try {
|
|
125
127
|
fs.writeFileSync(filePath, data, "utf-8");
|
|
126
128
|
} catch (error) {
|
|
127
|
-
|
|
129
|
+
if (error instanceof Error) {
|
|
130
|
+
console.error(error.message);
|
|
131
|
+
} else {
|
|
132
|
+
console.error("An unknown error occurred");
|
|
133
|
+
}
|
|
128
134
|
}
|
|
129
135
|
};
|
|
130
136
|
}
|
|
@@ -179,7 +185,7 @@ var init_src = __esm({
|
|
|
179
185
|
const { cwd } = options;
|
|
180
186
|
const packageManager = getPackageManager();
|
|
181
187
|
createConfigFile(configPath, options, packageManager);
|
|
182
|
-
console.log("Using package manager", packageManager);
|
|
188
|
+
console.log("Using package manager: ", packageManager);
|
|
183
189
|
console.log("Pixel Config (auto-generated) :", configPath);
|
|
184
190
|
return {
|
|
185
191
|
postcssPlugin: PLUGIN_NAME,
|