Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: change sideEffects & default export #2094

Merged
merged 1 commit into from
Feb 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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