Skip to content

Commit

Permalink
Merge pull request #23800 from storybookjs/kasper/fix-safari-static
Browse files Browse the repository at this point in the history
Esbuild: Fix support for older versions of Safari
  • Loading branch information
kasperpeulen committed Aug 11, 2023
2 parents 19d26cc + c936edc commit 8d8fc73
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion code/builders/builder-manager/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ export const getConfig: ManagerBuilder['getConfig'] = async (options) => {
'.eot': 'dataurl',
'.ttf': 'dataurl',
},
target: ['chrome100'],
target: ['chrome100', 'safari15', 'firefox91'],
platform: 'browser',
bundle: true,
minify: true,
Expand Down
4 changes: 1 addition & 3 deletions code/lib/cli/src/automigrate/fixes/missing-babelrc.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,7 @@ const babelContent = JSON.stringify({
[
'@babel/preset-env',
{
targets: {
chrome: 100,
},
targets: { chrome: 100, safari: 15, firefox: 91 },
},
],
'@babel/preset-typescript',
Expand Down
4 changes: 3 additions & 1 deletion code/lib/cli/src/babel-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@ export const writeBabelConfigFile = async ({
}) => {
const fileLocation = location || path.join(process.cwd(), '.babelrc.json');

const presets: (string | [string, any])[] = [['@babel/preset-env', { targets: { chrome: 100 } }]];
const presets: (string | [string, any])[] = [
['@babel/preset-env', { targets: { chrome: 100, safari: 15, firefox: 91 } }],
];

if (typescript) {
presets.push('@babel/preset-typescript');
Expand Down
2 changes: 1 addition & 1 deletion scripts/prepare/bundle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ const run = async ({ cwd, flags }: { cwd: string; flags: string[] }) => {
watch,
outDir,
format: ['esm'],
target: 'chrome100',
target: ['chrome100', 'safari15', 'firefox91'],
clean: false,
...(dtsBuild === 'esm' ? dtsConfig : {}),
platform: platform || 'browser',
Expand Down
2 changes: 1 addition & 1 deletion scripts/prepare/esm-bundle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ const run = async ({ cwd, flags }: { cwd: string; flags: string[] }) => {
outExtension: () => ({
js: '.js',
}),
target: 'chrome100',
target: ['chrome100', 'safari15', 'firefox91'],
clean: false,
...(dtsBuild ? dtsConfig : {}),
platform: 'browser',
Expand Down

0 comments on commit 8d8fc73

Please sign in to comment.