Skip to content

Commit

Permalink
misc(build): prefer paths when using gh-pages-app (GoogleChrome#12905)
Browse files Browse the repository at this point in the history
  • Loading branch information
connorjclark authored Aug 17, 2021
1 parent a9ab9a1 commit abda702
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 15 deletions.
20 changes: 9 additions & 11 deletions build/build-treemap.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,21 +49,19 @@ async function run() {
appDir: `${LH_ROOT}/lighthouse-treemap/app`,
html: {path: 'index.html'},
stylesheets: [
fs.readFileSync(require.resolve('tabulator-tables/dist/css/tabulator.min.css'), 'utf8'),
{path: require.resolve('tabulator-tables/dist/css/tabulator.min.css')},
{path: 'styles/*'},
],
javascripts: [
/* eslint-disable max-len */
fs.readFileSync(require.resolve('idb-keyval/dist/idb-keyval-min.js'), 'utf8'),
fs.readFileSync(require.resolve('event-target-shim/umd'), 'utf8'),
fs.readFileSync(require.resolve('webtreemap-cdt'), 'utf8'),
fs.readFileSync(require.resolve('tabulator-tables/dist/js/tabulator_core.js'), 'utf8'),
fs.readFileSync(require.resolve('tabulator-tables/dist/js/modules/sort.js'), 'utf8'),
fs.readFileSync(require.resolve('tabulator-tables/dist/js/modules/format.js'), 'utf8'),
fs.readFileSync(require.resolve('tabulator-tables/dist/js/modules/resize_columns.js'), 'utf8'),
fs.readFileSync(require.resolve('pako/dist/pako_inflate.js'), 'utf-8'),
/* eslint-enable max-len */
buildStrings(),
{path: require.resolve('idb-keyval/dist/idb-keyval-min.js')},
{path: require.resolve('event-target-shim/umd')},
{path: require.resolve('webtreemap-cdt')},
{path: require.resolve('tabulator-tables/dist/js/tabulator_core.js')},
{path: require.resolve('tabulator-tables/dist/js/modules/sort.js')},
{path: require.resolve('tabulator-tables/dist/js/modules/format.js')},
{path: require.resolve('tabulator-tables/dist/js/modules/resize_columns.js')},
{path: require.resolve('pako/dist/pako_inflate.js')},
{path: 'src/main.js', rollup: true},
],
assets: [
Expand Down
3 changes: 1 addition & 2 deletions build/build-viewer.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
*/
'use strict';

const fs = require('fs');
const browserify = require('browserify');
const GhPagesApp = require('./gh-pages-app.js');
const {minifyFileTransform} = require('./build-utils.js');
Expand Down Expand Up @@ -41,7 +40,7 @@ async function run() {
],
javascripts: [
await generatorJsPromise,
fs.readFileSync(require.resolve('pako/dist/pako_inflate.js'), 'utf-8'),
{path: require.resolve('pako/dist/pako_inflate.js')},
{path: 'src/main.js', rollup: true},
],
assets: [
Expand Down
4 changes: 2 additions & 2 deletions build/gh-pages-app.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,9 +131,9 @@ class GhPagesApp {
if (typeof source === 'string') {
result.push(source);
} else if (source.rollup) {
result.push(await this._rollupSource(`${this.opts.appDir}/${source.path}`));
result.push(await this._rollupSource(path.resolve(this.opts.appDir, source.path)));
} else {
result.push(...loadFiles(`${this.opts.appDir}/${source.path}`));
result.push(...loadFiles(path.resolve(this.opts.appDir, source.path)));
}
}

Expand Down

0 comments on commit abda702

Please sign in to comment.