@mekari/pixel3-postcss 0.0.7-dev.1 → 0.0.7-dev.3
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 +10 -6
- package/dist/index.mjs +10 -6
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -122,19 +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 = [...
|
|
130
|
-
|
|
129
|
+
const finalInclude = [..._defaultConfig.include, extend];
|
|
130
|
+
_defaultConfig.include = finalInclude;
|
|
131
131
|
}
|
|
132
|
-
const configs = mergeConfig(
|
|
132
|
+
const configs = mergeConfig(_defaultConfig, options);
|
|
133
133
|
const data = "export default" + JSON.stringify(configs, null, 2);
|
|
134
134
|
try {
|
|
135
135
|
fs.writeFileSync(filePath, data, "utf-8");
|
|
136
136
|
} catch (error) {
|
|
137
|
-
|
|
137
|
+
if (error instanceof Error) {
|
|
138
|
+
console.error(error.message);
|
|
139
|
+
} else {
|
|
140
|
+
console.error("An unknown error occurred");
|
|
141
|
+
}
|
|
138
142
|
}
|
|
139
143
|
};
|
|
140
144
|
|
|
@@ -179,7 +183,7 @@ var pixelcss = (options = {}) => {
|
|
|
179
183
|
const { cwd } = options;
|
|
180
184
|
const packageManager = getPackageManager();
|
|
181
185
|
createConfigFile(configPath, options, packageManager);
|
|
182
|
-
console.log("Using package manager", packageManager);
|
|
186
|
+
console.log("Using package manager: ", packageManager);
|
|
183
187
|
console.log("Pixel Config (auto-generated) :", configPath);
|
|
184
188
|
return {
|
|
185
189
|
postcssPlugin: PLUGIN_NAME,
|
package/dist/index.mjs
CHANGED
|
@@ -114,19 +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 = [...
|
|
122
|
-
|
|
121
|
+
const finalInclude = [..._defaultConfig.include, extend];
|
|
122
|
+
_defaultConfig.include = finalInclude;
|
|
123
123
|
}
|
|
124
|
-
const configs = mergeConfig(
|
|
124
|
+
const configs = mergeConfig(_defaultConfig, options);
|
|
125
125
|
const data = "export default" + JSON.stringify(configs, null, 2);
|
|
126
126
|
try {
|
|
127
127
|
fs.writeFileSync(filePath, data, "utf-8");
|
|
128
128
|
} catch (error) {
|
|
129
|
-
|
|
129
|
+
if (error instanceof Error) {
|
|
130
|
+
console.error(error.message);
|
|
131
|
+
} else {
|
|
132
|
+
console.error("An unknown error occurred");
|
|
133
|
+
}
|
|
130
134
|
}
|
|
131
135
|
};
|
|
132
136
|
}
|
|
@@ -181,7 +185,7 @@ var init_src = __esm({
|
|
|
181
185
|
const { cwd } = options;
|
|
182
186
|
const packageManager = getPackageManager();
|
|
183
187
|
createConfigFile(configPath, options, packageManager);
|
|
184
|
-
console.log("Using package manager", packageManager);
|
|
188
|
+
console.log("Using package manager: ", packageManager);
|
|
185
189
|
console.log("Pixel Config (auto-generated) :", configPath);
|
|
186
190
|
return {
|
|
187
191
|
postcssPlugin: PLUGIN_NAME,
|