Skip to content

Commit 1994d13

Browse files
committed
fix: Fix builds to support older browsers
1 parent 9b54f4d commit 1994d13

File tree

4 files changed

+122
-69
lines changed

4 files changed

+122
-69
lines changed

.github/workflows/main.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ jobs:
3434
- run: npm ci
3535
- run: npm run setup-website
3636
- run: npm run ci-xvfb
37+
- run: npm run validate-es5
3738
- run: npm run ci-build-website
3839
- uses: codecov/codecov-action@v5
3940
with:

package-lock.json

Lines changed: 116 additions & 67 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
"@babel/preset-env": "^7.16.5",
3939
"@fontsource/lato": "^5.1.1",
4040
"@jsdevtools/coverage-istanbul-loader": "^3.0.5",
41+
"acorn": "^8.15.0",
4142
"babel-loader": "^10.0.0",
4243
"babel-plugin-istanbul": "^7.0.0",
4344
"bootstrap": "^5.0.0",
@@ -108,7 +109,7 @@
108109
"glob": "^13.0.0"
109110
},
110111
"vtk.js": {
111-
"xmlbuilder2": "^4.0.0"
112+
"xmlbuilder2": "^4.0.0"
112113
}
113114
},
114115
"release": {
@@ -176,6 +177,7 @@
176177
"setup-website": "cd website && npm install",
177178
"build-website": "npm-run-all ci-build ci-build-website",
178179
"ci-build-website": "cp -a dist/built/. website/source/built && bash -c '(npm run build-website-examples & npm run build-website-tutorials & wait -n && wait -n)' && cd dist && cp -ar data ../website/source/. && rm -rf ../website/source/data/tiles && rm -rf ../website/source/data/tiles.tgz && rm -rf ../website/source/data/base-images && rm -rf ../website/source/data/base-images.tgz && cp -ar apidocs/. ../website/source/apidocs && cd ../website && npm install && rm -f db.json && npx hexo generate",
180+
"validate-es5": "node -e \"const fs=require('fs'),acorn=require('acorn');fs.readdirSync('dist/built').forEach(f=>{if(f.endsWith('.js')){try{acorn.parse(fs.readFileSync('dist/built/'+f,'utf8'),{ecmaVersion:5})}catch(e){console.error('ES5 syntax error in dist/built/'+f+':',e.message);process.exit(1)}}});console.log('All files in dist/built pass ES5 syntax check.')\"",
179181
"prepublishOnly": "npm run build && cp dist/built/*.js .",
180182
"semantic-release": "semantic-release"
181183
},

webpack.base.config.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,11 @@ module.exports = {
5555
test: /\.(js|cjs)$/,
5656
include: [
5757
path.resolve('src'),
58+
/node_modules\/@velipso\/polybool/
5859
/node_modules\/earcut/,
5960
/node_modules\/kdbush/,
61+
/node_modules\/proj4/,
6062
/node_modules\/wkt-parser/,
61-
/node_modules\/@velipso\/polybool/
6263
],
6364
use: [{
6465
loader: 'babel-loader',

0 commit comments

Comments
 (0)