Skip to content
Open
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
3 changes: 3 additions & 0 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import Label from './components/atoms/Label';
import Tag, { TagVanilla } from './components/atoms/Tag';
import Textarea, { TextareaVanilla } from './components/atoms/Textarea';
import Video, { VideoVanilla } from './components/atoms/Video';
import Icon, { IconVanilla } from './components/atoms/Icon';

/**
* Molecules
Expand Down Expand Up @@ -96,4 +97,6 @@ export {
Carousel,
CarouselVanilla,
GlobalStyles,
Icon,
IconVanilla,
};
9 changes: 7 additions & 2 deletions scripts/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,18 @@ const shell = (cmd) => execa(cmd, { stdio: ['pipe', 'pipe', 'inherit'], shell: t

const has = (t) => !targets.length || targets.includes(t);

const copyStyles = async (target) => {
await shell(`cp -a ${srcRoot}/styles/themes/base/icons/. ${target}/styles/themes/base/icons/`);
await shell(`cp -a ${srcRoot}/styles/themes/base/tokens/. ${target}/styles/themes/base/tokens/`);
};

/**
* Run babel over the src directory and output
* compiled common js files to ./lib.
*/
const buildLib = step('commonjs modules', libRoot, async () => {
await shell(`npx babel ${srcRoot} --out-dir ${libRoot} --env-name "lib"`);
await copyStyles(libRoot);
await shell('echo "// @flow\n\nexport * from \'../lib\'" > dist/index.js.flow');
});

Expand All @@ -41,8 +47,7 @@ const buildLib = step('commonjs modules', libRoot, async () => {
*/
const buildEsm = step('es modules', esRoot, async () => {
await shell(`npx babel ${srcRoot} --out-dir ${esRoot} --env-name "esm"`);
await shell(`cp -a ${srcRoot}/styles/themes/base/icons/. ${esRoot}/styles/themes/base/icons/`);
await shell(`cp -a ${srcRoot}/styles/themes/base/tokens/. ${esRoot}/styles/themes/base/tokens/`);
await copyStyles(esRoot);
await shell('echo "// @flow\n\nexport * from \'../../lib\'" > dist/es/index.js.flow');
});

Expand Down