Skip to content

Commit

Permalink
feat: 独立一个markdown样式文件(含主题)
Browse files Browse the repository at this point in the history
  • Loading branch information
sunsonliu committed Jun 24, 2024
1 parent 6089004 commit 467d870
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 31 deletions.
33 changes: 2 additions & 31 deletions build/rollup.styles.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,13 @@ const options = [
],
},
{
input: 'src/sass/previewer.scss',
input: 'src/sass/markdown_pure.scss',
output: {
file: 'dist/cherry-previewer.styles.js',
},
plugins: [
scss({
fileName: IS_PRODUCTION ? 'cherry-markdown.previewer.min.css' : 'cherry-markdown.previewer.css',
fileName: IS_PRODUCTION ? 'cherry-markdown.markdown.min.css' : 'cherry-markdown.markdown.css',
// node进程是否在错误时终止
failOnError: true,
...(IS_PRODUCTION && {
Expand All @@ -79,35 +79,6 @@ const options = [
},
],
},
// {
// input: 'src/sass/markdown.scss',
// output: {
// file: 'dist/cherry-markdown.styles.js',
// },
// plugins: [
// scss({
// // Filename to write all styles to
// fileName: IS_PRODUCTION ? 'cherry-markdown.markdown.min.css' : 'cherry-markdown.markdown.css',

// // Determine if node process should be terminated on error (default: false)
// failOnError: true,
// ...(IS_PRODUCTION && {
// outputStyle: 'compressed',
// }),
// sass: dartSass,
// }),
// {
// generateBundle: (option, bundle) => {
// // remove all non-asset files from bundle
// Object.keys(bundle).forEach((key) => {
// if (bundle[key].type !== 'asset') {
// delete bundle[key];
// }
// });
// },
// },
// ],
// },
];

export default options;
9 changes: 9 additions & 0 deletions src/sass/markdown_pure.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
@import './markdown.scss';
/** 引入自带的主题 */
@import './themes/default.scss';
@import './themes/dark.scss';
@import './themes/light.scss';
@import './themes/green.scss';
@import './themes/red.scss';
@import './themes/violet.scss';
@import './themes/blue.scss';

0 comments on commit 467d870

Please sign in to comment.