Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Webpack5: Remove babel and SWC compiler from builder #25379

Merged
merged 58 commits into from
Jan 10, 2024
Merged
Show file tree
Hide file tree
Changes from 50 commits
Commits
Show all changes
58 commits
Select commit Hold shift + click to select a range
0688ef0
Remove Babel from webpack5 builder
valentinpalkovic Dec 28, 2023
cf05ed1
Remove babel cache preset from core-server
valentinpalkovic Dec 28, 2023
89ec937
Remove internal swc-webpack template
valentinpalkovic Dec 28, 2023
badd683
Adjust CLI Init to install appropriate Webpack5 compiler
valentinpalkovic Dec 28, 2023
d88b388
Do not apply default babel plugins for preact
valentinpalkovic Dec 28, 2023
2cfff03
Remove Preact 8 support
valentinpalkovic Dec 28, 2023
a3d0330
Remove fast-refresh
valentinpalkovic Dec 28, 2023
ce4f309
Remove deprecated code
valentinpalkovic Dec 28, 2023
83a0254
Update lock file
valentinpalkovic Dec 28, 2023
5023619
Add custom babel-loader to Next.js
valentinpalkovic Dec 29, 2023
75a0937
Readd babel-plugin-react-docgen for testing purposes
valentinpalkovic Dec 29, 2023
c1d748a
Only use swc mode in Next.js for version gte 14
valentinpalkovic Dec 29, 2023
df14928
Readd webpack module.rules to babel and swc loader configuration
valentinpalkovic Dec 29, 2023
f164cd1
Fix build step
valentinpalkovic Dec 29, 2023
ec5c571
Implement fast refresh for Next.js
valentinpalkovic Dec 29, 2023
b03d483
Add custom babel-loader to Ember.js
valentinpalkovic Dec 30, 2023
1f8db9e
Remove @swc/core package
valentinpalkovic Dec 30, 2023
9ed26ab
Add Migration note to Next.js SWC mode
valentinpalkovic Dec 30, 2023
105e3ff
Add Migration note for Preact
valentinpalkovic Dec 30, 2023
da46a9e
Add Migration note to drop support for Preact < 10
valentinpalkovic Dec 30, 2023
068cdf1
Add note to addon authors for optional babel usage
valentinpalkovic Dec 30, 2023
56ff8b2
Readd deleted snippets
valentinpalkovic Dec 30, 2023
bb9370c
Add Migration note for removing fastRefresh option
valentinpalkovic Dec 30, 2023
6808657
Add cache directory to babel-loaders
valentinpalkovic Jan 2, 2024
6c5b0b8
Add migration note for babel/swc removal
valentinpalkovic Jan 2, 2024
c82e215
Upgrade yarn.lock
valentinpalkovic Jan 2, 2024
ef3da4c
Merge remote-tracking branch 'origin/next' into valentin/remove-babel…
valentinpalkovic Jan 2, 2024
dbcade2
Merge remote-tracking branch 'origin/next' into valentin/remove-babel…
valentinpalkovic Jan 3, 2024
b8db539
Add migration note for web-component projects
valentinpalkovic Jan 3, 2024
87cd401
Merge remote-tracking branch 'origin/next' into valentin/remove-babel…
valentinpalkovic Jan 4, 2024
0c78429
Add more details to SWC configuration option in TypeScript
valentinpalkovic Jan 5, 2024
b29c24f
Merge branch 'next' into valentin/remove-babel-from-webpack5-builder
valentinpalkovic Jan 5, 2024
0e638f6
Avoid implicit any in preact-webpack
valentinpalkovic Jan 5, 2024
e2d9306
Restructure dependencies in ember package.json
valentinpalkovic Jan 5, 2024
2b606eb
Add migration note for sb babelrc removal
valentinpalkovic Jan 5, 2024
3854cc2
Beautify Migration.md
valentinpalkovic Jan 5, 2024
30ac388
Beautify Migration.md
valentinpalkovic Jan 5, 2024
88c212a
Update lock file
valentinpalkovic Jan 5, 2024
ccbb6e4
Update snapshot
valentinpalkovic Jan 5, 2024
b8d0969
Format docs
valentinpalkovic Jan 5, 2024
2a83033
Add missing semver dep to cra preset
valentinpalkovic Jan 5, 2024
33f6196
Add compiler addon to package.json
valentinpalkovic Jan 5, 2024
7b18c3a
Add Compiler addons to verdaccio config
valentinpalkovic Jan 5, 2024
75087a2
Fix overridePresets loading in build-dev/static
valentinpalkovic Jan 5, 2024
66a2a69
Set enforce: pre to react docgen loader
valentinpalkovic Jan 5, 2024
bb7452d
Setup a babel webpack5 react sandbox
valentinpalkovic Jan 5, 2024
c017e0d
Add requested documentation changes
valentinpalkovic Jan 8, 2024
93aea84
Merge remote-tracking branch 'origin/next' into valentin/remove-babel…
valentinpalkovic Jan 8, 2024
d343aef
Prettify docs
valentinpalkovic Jan 8, 2024
9796ff8
Update docs
valentinpalkovic Jan 9, 2024
27935a5
Update MIGRATION.md
valentinpalkovic Jan 9, 2024
d19f82e
Update MIGRATION.md
valentinpalkovic Jan 9, 2024
6c6946e
Update MIGRATION.md
valentinpalkovic Jan 9, 2024
5b9fc33
Update MIGRATION.md
valentinpalkovic Jan 9, 2024
10ad2a4
Merge remote-tracking branch 'origin/next' into valentin/remove-babel…
valentinpalkovic Jan 9, 2024
8aff1dd
Update MIGRATION.md
valentinpalkovic Jan 9, 2024
bd4aa2c
Update MIGRATION.md
valentinpalkovic Jan 9, 2024
618d45c
Update MIGRATION.md
valentinpalkovic Jan 9, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
181 changes: 177 additions & 4 deletions MIGRATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@
- [Dropping support for \*.stories.mdx (CSF in MDX) format and MDX1 support](#dropping-support-for-storiesmdx-csf-in-mdx-format-and-mdx1-support)
- [Dropping support for id, name and story in Story block](#dropping-support-for-id-name-and-story-in-story-block)
- [Core changes](#core-changes)
- [`framework.options.builder.useSWC` for Webpack5-based projects removed](#frameworkoptionsbuilderuseswc-for-webpack5-based-projects-removed)
- [Removed `@babel/core` and `babel-loader` from `@storybook/builder-webpack5`](#removed-babelcore-and-babel-loader-from-storybookbuilder-webpack5)
- [`framework.options.fastRefresh` for Webpack5-based projects removed](#frameworkoptionsfastrefresh-for-webpack5-based-projects-removed)
- [`typescript.skipBabel` removed](#typescriptskipbabel-removed)
- [Dropping support for Yarn 1](#dropping-support-for-yarn-1)
- [Dropping support for Node.js 16](#dropping-support-for-nodejs-16)
- [Autotitle breaking fixes](#autotitle-breaking-fixes)
Expand All @@ -19,15 +23,22 @@
- [Icons is deprecated](#icons-is-deprecated)
- [Removed postinstall](#removed-postinstall)
- [Removed stories.json](#removed-storiesjson)
- [Removed `sb babelrc` command](#removed-sb-babelrc-command)
- [Framework-specific changes](#framework-specific-changes)
- [React](#react)
- [`react-docgen` component analysis by default](#react-docgen-component-analysis-by-default)
- [Next.js](#nextjs)
- [Require Next.js 13.5 and up](#require-nextjs-135-and-up)
- [Automatic SWC mode detection](#automatic-swc-mode-detection)
- [Angular](#angular)
- [Require Angular 15 and up](#require-angular-15-and-up)
- [Svelte](#svelte)
- [Require Svelte 4 and up](#require-svelte-4-and-up)
- [Preact](#preact)
- [Require Preact 10 and up](#require-preact-10-and-up)
- [No longer adds default Babel plugins](#no-longer-adds-default-babel-plugins)
- [Web Components](#web-components)
- [Dropping default babel plugins in Webpack5-based projects](#dropping-default-babel-plugins-in-webpack5-based-projects)
- [Deprecations which are now removed](#deprecations-which-are-now-removed)
- [--use-npm flag in storybook CLI](#--use-npm-flag-in-storybook-cli)
- [`setGlobalConfig` from `@storybook/react`](#setglobalconfig-from-storybookreact)
Expand Down Expand Up @@ -457,6 +468,95 @@ Referencing stories by `id`, `name` or `story` in the Story block is not possibl

### Core changes

#### `framework.options.builder.useSWC` for Webpack5-based projects removed

In Storybook 8.0, we have removed the `framework.options.builder.useSWC` option. The `@storybook/builder-webpack5` package is now compiler-agnostic and does not depend on Babel or SWC.

If you want to use SWC, you can add the necessary addon:

```sh
npx storybook@latest add @storybook/addon-webpack-compiler-swc
```

The goal is to make @storybook/builder-webpack5 lighter and more flexible. We are not locked into a specific compiler or compiler version anymore. This allows us to support Babel 7/8, SWC, and other compilers simultaneously.

#### Removed `@babel/core` and `babel-loader` from `@storybook/builder-webpack5`

In Storybook 8.0, we have removed the `@storybook/builder-webpack5` package's dependency on Babel. This means that Babel is not preconfigured in `@storybook/builder-webpack5`. If you want to use Babel, you can add the necessary addon:

```sh
npx storybook@latest add @storybook/addon-webpack-compiler-swc
```

We are doing this to make Storybook more flexible and to allow users to use a variety of compilers like SWC, Babel or even pure TypeScript.

#### `framework.options.fastRefresh` for Webpack5-based projects removed

In Storybook 8.0, we have removed the `framework.options.fastRefresh` option.

The fast-refresh implementation currently relies on the `react-refresh/babel` package. While this has served us well, integrating this dependency could pose challenges. Specifically, it would necessitate locking users into a specific Babel version. This could become a bottleneck, especially when Babel 8 is released. There is uncertainty about whether react-refresh/babel will seamlessly support Babel 8, potentially hindering users from updating smoothly.
valentinpalkovic marked this conversation as resolved.
Show resolved Hide resolved

Furthermore, the existing implementation does not account for cases where fast-refresh might already be configured in a user's Babel configuration. Rather than filtering out existing configurations, our current approach could lead to duplications, resulting in a less-than-optimal development experience.
valentinpalkovic marked this conversation as resolved.
Show resolved Hide resolved

We believe in empowering our users, and setting up fast-refresh manually is a straightforward process. By adding the following configuration, users can easily configure fast-refresh according to their specific needs if it is not already configured or if Storybook does not automatically pick up your fast-refresh configuration:
valentinpalkovic marked this conversation as resolved.
Show resolved Hide resolved

`package.json`:

```diff
{
"devDependencies": {
+ "@pmmmwh/react-refresh-webpack-plugin": "^0.5.11",
+ "react-refresh": "^0.14.0",
}
}
```

`babel.config.js` (optionally, add it to `.storybook/main.js`):

```diff
+const isProdBuild = process.env.NODE_ENV === 'production';

module.exports = (api) => {
return {
plugins: [
+ !isProdBuild && 'react-refresh/babel',
].filter(Boolean),
};
};
```

`.storybook/main.js`:

```diff
+import ReactRefreshWebpackPlugin from "@pmmmwh/react-refresh-webpack-plugin";
+const isProdBuild = process.env.NODE_ENV === 'production';
const config = {
webpackFinal: (config) => {
+ config.plugins = [
+ !isProdBuild && new ReactRefreshWebpackPlugin({
+ overlay: {
+ sockIntegration: 'whm',
+ },
+ }),
+ ...config.plugins,
+ ].filter(Boolean);
return config;
},
};

export default config;
```

This approach aligns with our philosophy of transparency and puts users in control of their Webpack and Babel configurations.

We are committed to minimizing magic behind the scenes. By removing `framework.options.fastRefresh`, we are moving closer to a Storybook that doesn't impose unnecessary configurations on users. Instead, we encourage users to leverage their existing Webpack and Babel setups, fostering a more transparent and customizable development environment.
valentinpalkovic marked this conversation as resolved.
Show resolved Hide resolved

You don't have to add fast refresh to `@storybook/nextjs` since it is already configured there as a default to match the same experience as `next dev`.

#### `typescript.skipBabel` removed

We have removed the `typescript.skipBabel` option in Storybook 8.0. Please use `typescript.skipCompiler` instead.

#### Dropping support for Yarn 1

Storybook will stop providing fixes aimed at Yarn 1 projects. This does not necessarily mean that Storybook will stop working for Yarn 1 projects, just that the team won't provide more fixes aimed at it. For context, it's been 6 years since the release of Yarn 1, and Yarn is currently in version 4, which was [released in October 2023](https://yarnpkg.com/blog/release/4.0).
Expand Down Expand Up @@ -545,6 +645,14 @@ In addition to the built storybook, `storybook build` generates two files, `inde

In the meantime if you have code that relies on `stories.json`, you can find code that transforms the "v4" `index.json` to the "v3" `stories.json` format (and their respective TS types): https://github.com/storybookjs/storybook/blob/release-7-5/code/lib/core-server/src/utils/stories-json.ts#L71-L91

#### Removed `sb babelrc` command

The `sb babelrc` command was used to generate a `.babelrc` file for Storybook. This command is now removed.

From version 8.0 onwards, Storybook is compiler-agnostic and does not depend on Babel or SWC if you use Webpack 5. This move was made to make Storybook more flexible and allow users to configure their own Babel setup according to their project needs and setup, leading to removing the `sb babelrc` command from Storybook. However, if you need to include a custom Babel configuration, we encourage you to create a `.babelrc` file yourself and configure it according to your project setup.
valentinpalkovic marked this conversation as resolved.
Show resolved Hide resolved

The reasoning behind is to condense and provide some clarity to what's happened to both the command and what's shifted with the upcoming release.

### Framework-specific changes

#### React
Expand All @@ -571,6 +679,13 @@ For more information see: https://storybook.js.org/docs/react/api/main-config-ty

Starting in 8.0, Storybook requires Next.js 13.5 and up.

##### Automatic SWC mode detection

Similar to how Next.js detects if SWC should be used, Storybook will follow more or less the same rules:

- If you use Next.js 14 or higher and you don't have a .babelrc file, Storybook will use SWC to transpile your code.
- Even if you have a .babelrc file, Storybook will still use SWC to transpile your code if you set the experimental `experimental.forceSwcTransforms` flag to `true` in your `next.config.js`.

#### Angular

##### Require Angular 15 and up
Expand All @@ -583,6 +698,64 @@ Starting in 8.0, Storybook requires Angular 15 and up.

Starting in 8.0, Storybook requires Svelte 4 and up.

#### Preact

##### Require Preact 10 and up

Starting in 8.0, Storybook requires Preact 10 and up.

##### No longer adds default Babel plugins

Until now, Storybook provided a set of default Babel plugins that were applied to Preact projects using Webpack, including the runtime automatic import plugin to allow Preact's h pragma to render JSX. However, this is no longer the case in Storybook 8.0. If you want to use this plugin, or if you're going to use TypeScript with Preact, you will need to add it to your Babel config.
valentinpalkovic marked this conversation as resolved.
Show resolved Hide resolved

```js
.babelrc

{
"plugins": [
[
// Add this to automatically import `h` from `preact` when needed
"@babel/plugin-transform-react-jsx", {
"importSource": "preact",
"runtime": "automatic"
}
],
// Add this if you want to use TypeScript with Preact
"@babel/preset-typescript"
],
}
```

If you want to configure the plugins only for Storybook, you can add the same setting to your `.storybook/main.js` file.

```js
const config = {
...
babel: async (options) => {
options.plugins.push(
[
"@babel/plugin-transform-react-jsx", {
"importSource": "preact",
"runtime": "automatic"
}
],
"@babel/preset-typescript"
)
return options;
},
}

export default config
```

We are doing this to apply the same configuration you defined in your project. This streamlines the experience of using Storybook with Preact. Additionally, we are not vendor-locked to a specific Babel version anymore, which means that you can upgrade Babel without breaking your Storybook.

#### Web Components

##### Dropping default babel plugins in Webpack5-based projects

Until the 8.0 release, Storybook provided the `@babel/preset-env` preset for Web Component projects by default. This is no longer the case, as any Web Components project will use the configuration you've included. Additionally, if you're using either the `@babel/plugin-syntax-dynamic-import` or `@babel/plugin-syntax-import-meta` plugins, you no longer have to include them as they are now part of the @babel/preset-env preset.
valentinpalkovic marked this conversation as resolved.
Show resolved Hide resolved

### Deprecations which are now removed

#### --use-npm flag in storybook CLI
Expand Down Expand Up @@ -754,7 +927,7 @@ To summarize:

#### typescript.skipBabel deprecated

We will remove the `typescript.skipBabel` option in Storybook 8.0.0. Please use `typescript.skipCompiler` instead.
We will remove the `typescript.skipBabel` option in Storybook 8.0. Please use `typescript.skipCompiler` instead.

#### Primary doc block accepts of prop

Expand Down Expand Up @@ -787,7 +960,7 @@ These changes should not be breaking for your users, unless you support Storyboo

#### `storyStoreV6` and `storiesOf` is deprecated

`storyStoreV6` and `storiesOf` is deprecated and will be completely removed in Storybook 8.0.0.
`storyStoreV6` and `storiesOf` is deprecated and will be completely removed in Storybook 8.0.

If you're using `storiesOf` we recommend you migrate your stories to CSF3 for a better story writing experience.
In many cases you can get started with the migration by using two migration scripts:
Expand All @@ -807,7 +980,7 @@ Alternatively you can build your own `storiesOf` implementation by leveraging th

#### `storyIndexers` is replaced with `experimental_indexers`

Defining custom indexers for stories has become a more official - yet still experimental - API which is now configured at `experimental_indexers` instead of `storyIndexers` in `main.ts`. `storyIndexers` has been deprecated and will be fully removed in version 8.0.0.
Defining custom indexers for stories has become a more official - yet still experimental - API which is now configured at `experimental_indexers` instead of `storyIndexers` in `main.ts`. `storyIndexers` has been deprecated and will be fully removed in version 8.0.

The new experimental indexers are documented [here](https://storybook.js.org/docs/react/api/main-config-indexers). The most notable change from `storyIndexers` is that the indexer must now return a list of [`IndexInput`](https://github.com/storybookjs/storybook/blob/next/code/lib/types/src/modules/indexer.ts#L104-L148) instead of `CsfFile`. It's possible to construct an `IndexInput` from a `CsfFile` using the `CsfFile.indexInputs` getter.

Expand Down Expand Up @@ -871,7 +1044,7 @@ addons.register('my-addon', () => {
});
```

The API: `addons.addPanel()` is now deprecated, and will be removed in 8.0.0. Please use `addons.add()` instead.
The API: `addons.addPanel()` is now deprecated, and will be removed in 8.0. Please use `addons.add()` instead.

The `render` method can now be a `React.FunctionComponent` (without the `children` prop). Storybook will now render it, rather than calling it as a function.

Expand Down
6 changes: 1 addition & 5 deletions RESOLUTIONS.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,4 @@ svelte-check@3.4.6 (bug: 3.5.x): Type issues

## code/ui/components/package.json

overlayscrollbars@2.2.1 (bug: 2.3.x): The Scrollbar doesn't disappear anymore by default. It might has something to do with the `scrollbars.autoHideSuspend` option, which was introduced in 2.3.0. https://github.com/KingSora/OverlayScrollbars/blob/master/packages/overlayscrollbars/CHANGELOG.md#230

## code/package.json

@babel/core@^7.23.2: Make sure we use the latest version of @babel/traverse, which is a dependency of @babel/core, since it contains a fix for a vulnerability: https://security.snyk.io/vuln/SNYK-JS-BABELTRAVERSE-5962462
overlayscrollbars@2.2.1 (bug: 2.3.x): The Scrollbar doesn't disappear anymore by default. It might has something to do with the `scrollbars.autoHideSuspend` option, which was introduced in 2.3.0. https://github.com/KingSora/OverlayScrollbars/blob/master/packages/overlayscrollbars/CHANGELOG.md#230
2 changes: 1 addition & 1 deletion code/addons/controls/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -176,4 +176,4 @@ Like [story parameters](https://storybook.js.org/docs/react/writing-stories/para

### How do controls work with MDX?

When importing stories from your CSF file into MDX, controls will work the same way. See [the documentation](https://storybook.js.org/docs/writing-docs/mdx#basic-example) for examples.
When importing stories from your CSF file into MDX, controls will work the same way. See [the documentation](https://storybook.js.org/docs/writing-docs/mdx#basic-example) for examples.
4 changes: 0 additions & 4 deletions code/builders/builder-webpack5/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@
"prep": "node --loader ../../../scripts/node_modules/esbuild-register/loader.js -r ../../../scripts/node_modules/esbuild-register/register.js ../../../scripts/prepare/bundle.ts"
},
"dependencies": {
"@babel/core": "^7.23.2",
"@storybook/channels": "workspace:*",
"@storybook/client-logger": "workspace:*",
"@storybook/core-common": "workspace:*",
Expand All @@ -72,10 +71,8 @@
"@storybook/node-logger": "workspace:*",
"@storybook/preview": "workspace:*",
"@storybook/preview-api": "workspace:*",
"@swc/core": "^1.3.82",
"@types/node": "^18.0.0",
"@types/semver": "^7.3.4",
"babel-loader": "^9.0.0",
"browser-assert": "^1.2.1",
"case-sensitive-paths-webpack-plugin": "^2.4.0",
"constants-browserify": "^1.0.0",
Expand All @@ -90,7 +87,6 @@
"process": "^0.11.10",
"semver": "^7.3.7",
"style-loader": "^3.3.1",
"swc-loader": "^0.2.3",
"terser-webpack-plugin": "^5.3.1",
"ts-dedent": "^2.0.0",
"url": "^0.11.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import TerserWebpackPlugin from 'terser-webpack-plugin';
import VirtualModulePlugin from 'webpack-virtual-modules';
import ForkTsCheckerWebpackPlugin from 'fork-ts-checker-webpack-plugin';
import type { TransformOptions as EsbuildOptions } from 'esbuild';
import type { JsMinifyOptions as SwcOptions } from '@swc/core';
import type { Options } from '@storybook/types';
import { globalsNameReferenceMap } from '@storybook/preview/globals';
import {
Expand All @@ -20,7 +19,6 @@ import {
import { type BuilderOptions } from '@storybook/core-webpack';
import { dedent } from 'ts-dedent';
import type { TypescriptOptions } from '../types';
import { createBabelLoader, createSWCLoader } from './loaders';
import { getVirtualModules } from './virtual-module-mapping';

const getAbsolutePath = <I extends string>(input: I): I =>
Expand Down Expand Up @@ -106,8 +104,7 @@ export default async (

const builderOptions = await getBuilderOptions<BuilderOptions>(options);

const shouldCheckTs =
typescriptOptions.check && !typescriptOptions.skipBabel && !typescriptOptions.skipCompiler;
const shouldCheckTs = typescriptOptions.check && !typescriptOptions.skipCompiler;
const tsCheckOptions = typescriptOptions.checkOptions || {};

const cacheConfig = builderOptions.fsCache ? { cache: { type: 'filesystem' as const } } : {};
Expand Down Expand Up @@ -235,9 +232,6 @@ export default async (
fullySpecified: false,
},
},
builderOptions.useSWC
? await createSWCLoader(Object.keys(virtualModuleMapping), options)
: await createBabelLoader(options, typescriptOptions, Object.keys(virtualModuleMapping)),
{
test: /\.md$/,
type: 'asset/source',
Expand Down Expand Up @@ -273,7 +267,6 @@ export default async (
...(isProd
? {
minimize: true,
// eslint-disable-next-line no-nested-ternary
minimizer: options.build?.test?.esbuildMinify
? [
new TerserWebpackPlugin<EsbuildOptions>({
Expand All @@ -285,17 +278,6 @@ export default async (
},
}),
]
: builderOptions.useSWC
? [
new TerserWebpackPlugin<SwcOptions>({
minify: TerserWebpackPlugin.swcMinify,
terserOptions: {
sourceMap: !options.build?.test?.disableSourcemaps,
mangle: false,
keep_fnames: true,
},
}),
]
: [
new TerserWebpackPlugin({
parallel: true,
Expand Down
Loading