Skip to content

Commit

Permalink
fix(dev-tools): remove log prefix (#459)
Browse files Browse the repository at this point in the history
  • Loading branch information
Pessimistress authored Mar 8, 2024
1 parent ab1f5e0 commit 5074059
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 22 deletions.
4 changes: 1 addition & 3 deletions .ocularrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,7 @@ let ocularConfig = {

entry: {
test: 'test/node.ts',
'test-browser': 'test/browser.ts',
bench: 'test/bench/node.js',
'bench-browser': 'test/bench/browser.js',
'test-browser': 'test/index.html',
size: 'test/size/import-nothing.js'
}
};
Expand Down
3 changes: 1 addition & 2 deletions modules/dev-tools/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,7 @@
"ts-node": "~10.9.0",
"ts-patch": "^3.1.2",
"tsconfig-paths": "^4.1.1",
"vite": "^4.0.1",
"vite-plugin-html": "^3.2.0"
"vite": "^4.5.0"
},
"devDependencies": {
"puppeteer": "^22.0.0"
Expand Down
12 changes: 1 addition & 11 deletions modules/dev-tools/src/configuration/vite.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import {defineConfig} from 'vite';
import {getOcularConfig} from '../helpers/get-ocular-config.js';
import {createHtmlPlugin} from 'vite-plugin-html';
import {NodeGlobalsPolyfillPlugin} from '@esbuild-plugins/node-globals-polyfill';
import {NodeModulesPolyfillPlugin} from '@esbuild-plugins/node-modules-polyfill';

Expand All @@ -9,18 +8,9 @@ export default defineConfig(async ({mode}) => {
const entryPoint = ocularConfig.entry[`${mode}-browser`];

return {
plugins: entryPoint.endsWith('.html')
? []
: [
// If entry is a js/ts file, create a virtual html
createHtmlPlugin({
minify: false,
entry: ocularConfig.entry[`${mode}-browser`]
})
],
optimizeDeps: {
// Disable crawling the whole repo
entries: entryPoint.endsWith('.html') ? [entryPoint] : [],
entries: [entryPoint],
// Polyfill for Node environment (required by tape-promise)
esbuildOptions: {
define: {
Expand Down
12 changes: 6 additions & 6 deletions modules/dev-tools/src/helpers/get-ocular-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,9 @@ export type OcularConfig = {

entry?: {
test?: string;
'test-browser'?: string;
'test-browser'?: `${string}.html`;
bench?: string;
'bench-browser'?: string;
'bench-browser'?: `${string}.html`;
size?: string[] | string;
};
};
Expand Down Expand Up @@ -114,9 +114,9 @@ export type MaterializedOcularConfig = {

entry: {
test: string;
'test-browser': string;
'test-browser': `${string}.html`;
bench: string;
'bench-browser': string;
'bench-browser': `${string}.html`;
size: string[];
};
};
Expand Down Expand Up @@ -174,9 +174,9 @@ export async function getOcularConfig(

entry: {
test: 'test/index.ts',
'test-browser': 'test/browser.ts',
'test-browser': 'test/index.html',
bench: 'test/bench/index.ts',
'bench-browser': 'test/bench/browser.ts',
'bench-browser': 'test/bench/index.html',
size: ['test/size.ts']
},

Expand Down
9 changes: 9 additions & 0 deletions test/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<!doctype html>
<html>
<head>
<title>luma.gl tests</title>
</head>
<body>
<script type="module" src="./browser.ts"></script>
</body>
</html>

0 comments on commit 5074059

Please sign in to comment.