Skip to content

Commit

Permalink
fix: change sideEffects & default export (#2094)
Browse files Browse the repository at this point in the history
  • Loading branch information
eiinu committed Feb 6, 2023
1 parent 06c486e commit 4eea235
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 22 deletions.
4 changes: 2 additions & 2 deletions jd/generate-nutui.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ let fileStrBuild = `${importStr}
${installFunction}
const version = '${packageConfig.version}';
export { install, version, Locale, ${packages.join(',')}, ${methods.join(',')}};
export default { install, version, Locale};`;
export default { install, version};`;

fs.outputFile(path.resolve(__dirname, '../src/packages/nutui.vue.build.ts'), fileStrBuild, 'utf8', (error) => {
// logger.success(`${package_config_path} 文件写入成功`);
Expand All @@ -46,7 +46,7 @@ ${installFunction}
${importScssStr}
export const testComponents = { ${packages.join(',')}};
export { install, Locale, ${packages.join(',')}, ${methods.join(',')} };
export default { install, version:'${packageConfig.version}', Locale};`;
export default { install, version:'${packageConfig.version}'};`;
fs.outputFile(path.resolve(__dirname, '../src/packages/nutui.vue.ts'), fileStrDev, 'utf8', (error) => {
// logger.success(`${package_config_path} 文件写入成功`);
});
17 changes: 5 additions & 12 deletions jd/generate-unplugin-deps.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ export { ${element.name} };`;
});
});
outputFileEntry += components.map(name => `import { ${name} } from "./packages/${name.toLowerCase()}/index.mjs";`).join('\n');
outputFileEntry += `\nimport { Locale } from "./packages/locale/lang";
function install(app) {
outputFileEntry += `\nexport { Locale } from "./packages/locale/lang";
export function install(app) {
const packages = [${components.join(',')}];
packages.forEach((item) => {
if (item.install) {
Expand All @@ -59,17 +59,10 @@ function install(app) {
}
});
}
const version = '${packageConfig.version}';
var stdin_default = {
export const version = '${packageConfig.version}';
export default {
install,
version,
Locale
};
export {
stdin_default as default,
install,
version,
Locale
version
};`;

tasks.push(
Expand Down
7 changes: 3 additions & 4 deletions publish/nutui-taro/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,9 @@
"style": "dist/style.css",
"typings": "dist/types/index.d.ts",
"sideEffects": [
"dist/packages/**/*",
"dist/packages/locale/lang/*",
"dist/styles/**",
"dist/style.css"
"dist/packages/**/style.mjs",
"*.scss",
"*.css"
],
"web-types": "dist/smartips/web-types.json",
"keywords": [
Expand Down
6 changes: 2 additions & 4 deletions publish/nutui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,9 @@
"style": "dist/style.css",
"typings": "dist/types/index.d.ts",
"sideEffects": [
"dist/packages/**/*",
"dist/packages/**/style.mjs",
"dist/packages/locale/lang/*",
"dist/styles/**",
"dist/style.css"
"*.scss",
"*.css"
],
"web-types": "dist/smartips/web-types.json",
"keywords": [
Expand Down

0 comments on commit 4eea235

Please sign in to comment.