Skip to content

Commit

Permalink
chore: opt of theme gen
Browse files Browse the repository at this point in the history
  • Loading branch information
zombieJ committed Nov 26, 2021
1 parent 6f837e0 commit 142bda8
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 2 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,8 @@
"pub": "npm run version && antd-tools run pub",
"prepublishOnly": "antd-tools run guard",
"site:theme": "npm run site:theme-dark && npm run site:theme-compact",
"site:theme-dark": "cross-env ESBUILD=1 ANT_THEME=dark bisheng build --ssr -c ./site/bisheng.config.js",
"site:theme-compact": "cross-env ESBUILD=1 ANT_THEME=compact bisheng build --ssr -c ./site/bisheng.config.js",
"site:theme-dark": "cross-env ESBUILD=1 ANT_THEME=dark bisheng build -c ./site/bisheng.config.js",
"site:theme-compact": "cross-env ESBUILD=1 ANT_THEME=compact bisheng build -c ./site/bisheng.config.js",
"site": "npm run site:theme && cross-env NODE_ICU_DATA=node_modules/full-icu ESBUILD=1 concurrently \"bisheng build --ssr -c ./site/bisheng.config.js\"",
"sort": "npx sort-package-json",
"sort-api": "antd-tools run sort-api-table",
Expand Down
31 changes: 31 additions & 0 deletions site/bisheng.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,37 @@ module.exports = {
plugin.options.filename = `${ANT_THEME}.css`;
}
});

// Remove preset target
config.module.rules.forEach(rule => {
if (rule.options?.presets?.[1]?.[0]?.includes('preset-env')) {
delete rule.options.presets[1][1];
delete rule.options.plugins;
}
});

config.optimization.minimize = false;
delete config.optimization.minimizer;

config.externals = [
/^rc-.*/,
/^react.*/,
/^@ant-design\/.*/,
/^@babel\/.*/,
/^@algolia\/.*/,
/^@docsearch\/.*/,
/autocomplete.js/,
/docsearch.js/,
/.*\.md/,
/lodash/,
/jquery/,
/moment/,
/core-js/,
/jsonml/,
/ramda/,
/tinycolor/,
/bisheng-plugin/,
];
}

return config;
Expand Down

0 comments on commit 142bda8

Please sign in to comment.