Skip to content

Commit

Permalink
share DIST_DIR constant
Browse files Browse the repository at this point in the history
  • Loading branch information
spalger committed Sep 29, 2020
1 parent c0fe83e commit 535f420
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions packages/kbn-ui-shared-deps/scripts/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,14 @@ const webpack = require('webpack');
const Stats = require('webpack/lib/Stats');
const del = require('del');

const { distDir } = require('../index');
const { getWebpackConfig } = require('../webpack.config');

const DIST_DIR = Path.resolve(__dirname, '../target');

run(
async ({ log, flags }) => {
log.info('cleaning previous build output');
await del(Path.resolve(__dirname, '../target'));
await del(DIST_DIR);

const compiler = webpack(
getWebpackConfig({
Expand All @@ -51,19 +52,19 @@ run(
{
group: '@kbn/ui-shared-deps asset size',
id: 'kbn-ui-shared-deps.js',
value: Fs.statSync(Path.resolve(distDir, 'kbn-ui-shared-deps.js')).size,
value: Fs.statSync(Path.resolve(DIST_DIR, 'kbn-ui-shared-deps.js')).size,
},
{
group: '@kbn/ui-shared-deps asset size',
id: '[email protected]',
value: Fs.statSync(Path.resolve(distDir, '[email protected]')).size,
value: Fs.statSync(Path.resolve(DIST_DIR, '[email protected]')).size,
},
{
group: '@kbn/ui-shared-deps asset size',
id: 'css',
value:
Fs.statSync(Path.resolve(distDir, 'kbn-ui-shared-deps.css')).size +
Fs.statSync(Path.resolve(distDir, 'kbn-ui-shared-deps.v7.light.css')).size,
Fs.statSync(Path.resolve(DIST_DIR, 'kbn-ui-shared-deps.css')).size +
Fs.statSync(Path.resolve(DIST_DIR, 'kbn-ui-shared-deps.v7.light.css')).size,
},
];

Expand Down

0 comments on commit 535f420

Please sign in to comment.