All files / packages/design-system/scripts buildAssets.js

0% Statements 0/9
0% Branches 0/2
0% Functions 0/1
0% Lines 0/8

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17                                 
import path from 'path';
import fs from 'fs-extra';
import { fileURLToPath } from 'url';
 
const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
 
const root = path.resolve(__dirname, '../');
const publicDir = path.join(root, 'public/');
 
// Copy images to public directory to make them available to Storybook
fs.ensureDir(publicDir, (err) => {
  if (err) throw err;
  fs.copySync(path.resolve(root, 'assets/images'), path.join(publicDir, 'images'));
  fs.copySync(path.resolve(root, 'assets/images'), path.join(publicDir, 'assets/images'));
});