diff --git a/esbuild/build.mjs b/esbuild/build.mjs index 6cc6e754..df53590d 100755 --- a/esbuild/build.mjs +++ b/esbuild/build.mjs @@ -54,7 +54,14 @@ const common = { build({ ...common, entryPoints: ['src/scss/base.scss'], - outfile: 'dist/css/yfm-base.css', + outfile: 'dist/css/base.css', + format: 'iife', + plugins, + }), + build({ + ...common, + entryPoints: ['src/scss/_yfm-only.scss'], + outfile: 'dist/css/_yfm-only.css', format: 'iife', plugins, }), @@ -75,8 +82,14 @@ const common = { }); await build({ ...common, - entryPoints: ['dist/css/yfm-base.css'], - outfile: 'dist/css/yfm-base.min.css', + entryPoints: ['dist/css/base.css'], + outfile: 'dist/css/base.min.css', + minify: true, + }); + await build({ + ...common, + entryPoints: ['dist/css/_yfm-only.css'], + outfile: 'dist/css/_yfm-only.min.css', minify: true, }); })(); @@ -91,7 +104,7 @@ const common = { build({ ...common, entryPoints: ['src/js/base.ts'], - outfile: 'dist/js/yfm-base.js', + outfile: 'dist/js/base.js', }), build({ ...common, @@ -108,8 +121,8 @@ const common = { }); await build({ ...common, - entryPoints: ['dist/js/yfm-base.js'], - outfile: 'dist/js/yfm-base.min.js', + entryPoints: ['dist/js/base.js'], + outfile: 'dist/js/base.min.js', minify: true, }); })(); diff --git a/src/scss/_yfm-only.scss b/src/scss/_yfm-only.scss new file mode 100644 index 00000000..65bc0494 --- /dev/null +++ b/src/scss/_yfm-only.scss @@ -0,0 +1,10 @@ +/** + Note: This file excludes cut and tabs for flexibility, + as they may be handled separately in the future. + Direct usage is not recommended, as the file is subject + to changes without prior notice. +*/ + +@import 'note'; +@import 'file'; +@import 'table'; diff --git a/src/scss/base.scss b/src/scss/base.scss index 19c5814a..7b93b3cd 100644 --- a/src/scss/base.scss +++ b/src/scss/base.scss @@ -1,9 +1,6 @@ @import 'common'; -@import 'note'; @import 'anchor'; @import 'highlight'; @import 'code'; -@import 'file'; @import 'term'; -@import 'table'; @import 'modal'; diff --git a/src/scss/yfm.scss b/src/scss/yfm.scss index 380c81c6..58c0af6d 100644 --- a/src/scss/yfm.scss +++ b/src/scss/yfm.scss @@ -1,3 +1,4 @@ @import 'base'; +@import 'yfm-only'; @import '@diplodoc/cut-extension/runtime'; @import '@diplodoc/tabs-extension/runtime';