Skip to content

Commit

Permalink
Migrate from Terser and Babel to SWC (#6920)
Browse files Browse the repository at this point in the history
* Add SWC plugin for Rollup

* Update SWC options for minification and debugging

* Update rollup version and add swc options

* Refactor buildTarget function and swcOptions

* Update package-lock.json and rollup-swc-options.mjs

* linting

* added strip plugin

* Skipping lib check for tsconfig

* Update package-lock.json to add peer dependencies and new modules

- Added "peer": true to several existing dependencies to indicate peer dependencies.
- Introduced new modules: jackspeak (v3.4.3) and package-json-from-dist (v1.0.1) with their respective details.
- Added path-scurry (v1.11.1) and its dependency lru-cache (v10.4.3) with funding information.

These changes enhance dependency management and ensure compatibility with peer dependencies.

* Remove babel-parser from ESLint configuration

- Eliminated the babel-parser dependency from the ESLint configuration file.
- Updated the parser options to ensure compatibility with the existing setup.

These changes streamline the ESLint configuration and reduce unnecessary dependencies.

* Refactor SWC plugin import in rollup build target

- Changed the import name of the SWC plugin from 'swc' to 'swcPlugin' for clarity.
- Updated all instances in the buildTarget function to use the new import name.

These changes improve code readability and maintainability.

* Update package dependencies and clean up package-lock.json

- Removed several unused Babel-related dependencies from package.json and package-lock.json to streamline the project.
- Updated the package-lock.json to reflect the removal of these dependencies and added optional flags where applicable.
- Enhanced dependency management by ensuring that only necessary modules are retained, improving overall project maintainability.

* Remove rollup-script-target.mjs and update rollup-swc-options.mjs and rollup-spaces-to-tabs.mjs

- Deleted the rollup-script-target.mjs file, streamlining the build process.
- Updated swcOptions to ensure comments are preserved in the output when not minifying.
- Clarified documentation in rollup-spaces-to-tabs.mjs regarding the plugin's functionality.

These changes enhance code maintainability and improve the clarity of the build configuration.

* Update rollup-swc-options.mjs to maintain pure functions array formatting

- Adjusted the formatting of the `pure_funcs` array in the `swcOptions` function to ensure consistency.
- This change enhances code readability and maintains the existing functionality of the build configuration.

* Update package-lock.json to reflect dependency upgrades and removals

- Upgraded the version of the 'playcanvas' package from 2.3.0-dev to 2.4.0-dev.
- Updated several dependencies, including '@webgpu/types' from ^0.1.40 to ^0.1.52, and '@playcanvas/eslint-config' from ^2.0.2 to ^2.0.8.
- Removed multiple unused rebuild package lock

* Update package.json and package-lock.json to add optional dependencies for Rollup. See vitejs/vite#15532

- Added optional dependencies for various Rollup packages, including support for multiple platforms (Linux, Darwin, FreeBSD, Windows).
- Updated package-lock.json to reflect the addition of these optional dependencies and their respective versions.
- This change enhances cross-platform compatibility and ensures that the build process can leverage the appropriate Rollup binaries as needed.

* Update package.json and package-lock.json to upgrade @swc/core and related dependencies

- Upgraded @swc/core to version 1.10.1 and updated its dependencies across various platforms.
- Removed the optional dependency for @rollup/rollup-linux-x64-gnu.
- Updated @swc/types to version 0.1.17 for improved compatibility.
- These changes enhance the project's build capabilities and ensure better support for the latest SWC features.

* Refactor ESLint configuration by removing unnecessary parserOptions

- Removed the parserOptions.requireConfigFile setting from the ESLint configuration.

* Update package dependencies: remove @napi-rs/canvas, add canvas 3.0.1, and include several new devDependencies

- Removed the deprecated @napi-rs/canvas dependency from package.json and package-lock.json.
- Added canvas version 3.0.1 to both files.
- Introduced multiple new development dependencies, enhancing the project's capabilities and ensuring compatibility with the latest features.

* Update @swc/core to version 1.10.4 in package.json and package-lock.json

- Upgraded the @swc/core dependency from version 1.10.1 to 1.10.4 in both package.json and package-lock.json to ensure compatibility with the latest features and improvements.

* Refactor tsconfig.json: Remove skipLibCheck option from compilerOptions

- Eliminated the skipLibCheck option from the TypeScript configuration to enforce stricter type checking and improve code quality.
  • Loading branch information
marklundin authored Jan 9, 2025
1 parent 365c7bf commit d60ba07
Show file tree
Hide file tree
Showing 9 changed files with 420 additions and 4,991 deletions.
5 changes: 0 additions & 5 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import playcanvasConfig from '@playcanvas/eslint-config';
import babelParser from '@babel/eslint-parser';
import globals from 'globals';

// Extract or preserve existing JSDoc tags
Expand All @@ -15,10 +14,6 @@ export default [
languageOptions: {
ecmaVersion: 2022,
sourceType: 'module',
parser: babelParser,
parserOptions: {
requireConfigFile: false
},
globals: {
...globals.browser,
...globals.mocha,
Expand Down
Loading

0 comments on commit d60ba07

Please sign in to comment.