Skip to content

Commit

Permalink
call it es5 bundle not ie11
Browse files Browse the repository at this point in the history
  • Loading branch information
pauldambra committed Oct 17, 2024
1 parent 42136db commit cab3b21
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/es-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ jobs:
- run: pnpm install && pnpm build

- name: Run es-check to check if our ie11 bundle is ES5 compatible
run: npx es-check@7.2.1 es5 dist/array.full.ie11.js
run: npx es-check@7.2.1 es5 dist/array.full.es5.js
8 changes: 4 additions & 4 deletions rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import commonjs from '@rollup/plugin-commonjs'
import fs from 'fs'
import path from 'path'

const plugins = (supportIE11) => [
const plugins = (es5) => [
json(),
resolve({ browser: true }),
typescript({ sourceMap: true, outDir: './dist' }),
Expand All @@ -22,7 +22,7 @@ const plugins = (supportIE11) => [
[
'@babel/preset-env',
{
targets: supportIE11
targets: es5
? '>0.5%, last 2 versions, Firefox ESR, not dead, IE 11'
: '>0.5%, last 2 versions, Firefox ESR, not dead',
},
Expand All @@ -33,7 +33,7 @@ const plugins = (supportIE11) => [
toplevel: true,
compress: {
// 5 is the default if unspecified
ecma: supportIE11 ? 5 : 6,
ecma: es5 ? 5 : 6,
},
}),
]
Expand All @@ -55,7 +55,7 @@ const entrypointTargets = entrypoints.map((file) => {

const fileName = fileParts.join('.')

const pluginsForThisFile = plugins(fileName.includes('ie11'))
const pluginsForThisFile = plugins(fileName.includes('es5'))

// we're allowed to console log in this file :)
// eslint-disable-next-line no-console
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// a straight copy of the array.full.ts entrypoint,
// but will have different config when passed through rollup
// to allow IE11 support
// to allow es5/IE11 support

// it doesn't include recorder which doesn't support IE11,
// and it doesn't include web-vitals which doesn't support IE11
Expand Down
4 changes: 1 addition & 3 deletions testcafe/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,7 @@ export const staticFilesMock = RequestMock()
.respond((req, res) => {
// eslint-disable-next-line no-undef
const ENV_BROWSER = process.env.BROWSER
// eslint-disable-next-line no-console
console.log('setting up staticFilesMock for browser: ', ENV_BROWSER)
const fileToRead = ENV_BROWSER === 'browserstack:ie' ? '../dist/array.full.ie11.js' : '../dist/array.full.js'
const fileToRead = ENV_BROWSER === 'browserstack:ie' ? '../dist/array.full.es5.js' : '../dist/array.full.js'
// eslint-disable-next-line no-undef
const arrayjs = fs.readFileSync(path.resolve(__dirname, fileToRead))
res.setBody(arrayjs)
Expand Down

0 comments on commit cab3b21

Please sign in to comment.