Skip to content

Commit

Permalink
Use vite to build the library
Browse files Browse the repository at this point in the history
The build script using rollup is not needed anymore
also updated some dependencies
  • Loading branch information
jahow committed Feb 8, 2024
1 parent 1f3c12c commit d901c6f
Show file tree
Hide file tree
Showing 12 changed files with 2,313 additions and 763 deletions.
127 changes: 0 additions & 127 deletions build/generate-dist.js

This file was deleted.

2 changes: 1 addition & 1 deletion jest.config.js → jest.config.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ module.exports = {
testEnvironment: 'jsdom',
transform: {
'^.+\\.(ts|xml)$': [
'<rootDir>/jest.ts-transformer.js',
'<rootDir>/jest.ts-transformer.cjs',
{
isolatedModules: true,
stringifyContentPathRegex: '.(xml)$',
Expand Down
12 changes: 7 additions & 5 deletions jest.ts-transformer.js → jest.ts-transformer.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,15 @@ const tsJest = require('ts-jest').default;

module.exports = {
// this transformer applies ts-jest but also makes sure
// that Worker constructors get the full path
// that the Worker constructor get the full path
process(src, filename, options) {
const dir = path.dirname(filename);
const transformed = src.replace(
/new Worker\(new URL\(['"](.+)['"], import\.meta\.url\)/,
`new Worker('${dir}/$1'`
);
const transformed = src
.replace(
/new OgcClientWorker\(\)/,
`new Worker('${dir}/worker.ts', { type: 'module' })`
)
.replace(`import OgcClientWorker from './worker?worker&inline';`, '');
return tsJest
.createTransformer(options.transformerConfig)
.process(transformed, filename, options);
Expand Down
Loading

0 comments on commit d901c6f

Please sign in to comment.