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

feat(dist): export css and js without tabs and cuts #540

Merged
merged 5 commits into from
Oct 22, 2024
Merged
Show file tree
Hide file tree
Changes from 3 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
37 changes: 37 additions & 0 deletions esbuild/build.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,20 @@ const common = {
format: 'iife',
plugins,
}),
build({
...common,
entryPoints: ['src/scss/base.scss'],
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,
}),
build({
...common,
entryPoints: ['src/scss/print.scss'],
Expand All @@ -66,6 +80,18 @@ const common = {
outfile: 'dist/css/yfm.min.css',
minify: true,
});
await build({
...common,
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,
});
})();

(async function buildJs() {
Expand All @@ -75,6 +101,11 @@ const common = {
entryPoints: ['src/js/index.ts'],
outfile: 'dist/js/yfm.js',
}),
build({
...common,
entryPoints: ['src/js/base.ts'],
outfile: 'dist/js/base.js',
}),
build({
...common,
entryPoints: ['src/js/print/index.ts'],
Expand All @@ -88,4 +119,10 @@ const common = {
outfile: 'dist/js/yfm.min.js',
minify: true,
});
await build({
...common,
entryPoints: ['dist/js/base.js'],
outfile: 'dist/js/base.min.js',
minify: true,
});
})();
5 changes: 5 additions & 0 deletions src/js/base.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import './polyfill';
import './code';
import './term';
import './wide-mode';
import './patch';
6 changes: 1 addition & 5 deletions src/js/index.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
import '@diplodoc/cut-extension/runtime';
import '@diplodoc/tabs-extension/runtime';

import './polyfill';
import './code';
import './term';
import './wide-mode';
import './patch';
import './base';
12 changes: 12 additions & 0 deletions src/scss/_yfm-only.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/**
Note: This file excludes "cut" and "tabs" as they are handled separately
in dedicated extensions (packages). In the future, "note", "file", "term"
and "table" will also be excluded from this file and moved to yfm.scss,
once they are moved to separate packages. Direct usage is not recommended,
as the file is subject to changes without prior notice.
*/

@import 'note';
@import 'file';
@import 'table';
@import 'term';
4 changes: 4 additions & 0 deletions src/scss/base.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
@import 'common';
@import 'anchor';
@import 'highlight';
@import 'code';
11 changes: 2 additions & 9 deletions src/scss/yfm.scss
Original file line number Diff line number Diff line change
@@ -1,12 +1,5 @@
@import 'common';
@import 'note';
@import 'anchor';
@import 'highlight';
@import 'code';
@import 'file';
@import 'term';
@import 'table';
@import 'base';
@import 'yfm-only';
@import 'modal';

@import '@diplodoc/cut-extension/runtime';
@import '@diplodoc/tabs-extension/runtime';
Loading