Skip to content

Commit

Permalink
botonic-dx: use rspack as a bundler (#2968)
Browse files Browse the repository at this point in the history
## Description

@botonic/eslint-config
- upgrade dependencies 

@botonic/dx-bundler-rspack
- add dependencies removed from @botonic-dx

@botonic/dx
- add @botonic/dx-bundler-rspack to use rspack as a default bundler

@botonic/dx-bundler-webpack
- new package, it will not be used by default in @botonic/dx but if
someone wants to use webpack instead of rspack it can be installed
independently to have all the dependencies i an example of
`webpack.config.js`

## Context

Update `eslint` config to allow not `import React from 'react'` in
components using `rspack` as a builder
  • Loading branch information
Iru89 authored Jan 22, 2025
1 parent 2091a9f commit b960748
Show file tree
Hide file tree
Showing 27 changed files with 1,652 additions and 1,492 deletions.
2,112 changes: 1,109 additions & 1,003 deletions package-lock.json

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions packages/botonic-dx-bundler-rspack/baseline/rspack.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,11 @@ const typescriptLoaderConfig = [
syntax: 'typescript',
tsx: true,
},
transform: {
react: {
runtime: 'automatic',
},
},
keepClassNames: true,
},
},
Expand Down
27 changes: 19 additions & 8 deletions packages/botonic-dx-bundler-rspack/package.json
Original file line number Diff line number Diff line change
@@ -1,24 +1,35 @@
{
"name": "@botonic/dx-bundler-rspack",
"version": "0.30.0-alpha.4",
"version": "0.31.0-alpha.0",
"description": "Build Botonic bots with RSPack",
"scripts": {
"build": "echo Skipping build...",
"test": "echo \"Error: no test specified\" && exit 1"
},
"dependencies": {
"@rspack/cli": "^1.1.0",
"@rspack/core": "^1.1.0",
"@rspack/plugin-react-refresh": "^1.0.0",
"@swc/core": "^1.9.1",
"@rspack/cli": "^1.1.8",
"@rspack/core": "^1.1.8",
"@rspack/plugin-react-refresh": "^1.0.1",
"@swc/core": "^1.10.8",
"@swc/helpers": "^0.5.15",
"clean-webpack-plugin": "^4.0.0",
"crypto-browserify": "^3.12.1",
"css-loader": "^7.1.2",
"html-webpack-plugin": "^5.6.3",
"node-polyfill-webpack-plugin": "^4.0.0",
"image-minimizer-webpack-plugin": "^4.1.3",
"imagemin-gifsicle": "^7.0.0",
"imagemin-jpegtran": "^8.0.0",
"imagemin-optipng": "^8.0.0",
"imagemin-svgo": "^11.0.1",
"imagemin": "^9.0.0",
"node-polyfill-webpack-plugin": "^4.1.0",
"null-loader": "^4.0.1",
"react-refresh": "^0.14.2",
"sass-loader": "^16.0.3",
"react-refresh": "^0.16.0",
"sass-loader": "^16.0.4",
"sass": "^1.83.4",
"stream-browserify": "^3.0.0",
"style-loader": "^4.0.0",
"svgo": "^3.2.2",
"ts-node": "^10.9.2"
},
"author": "",
Expand Down
3 changes: 3 additions & 0 deletions packages/botonic-dx-bundler-webpack/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#not adding lock to avoid noise in repository
#since it only contains dev deps, upgrading too far will not breaking in runtime
package-lock.json
Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,15 @@ module.exports = {
sourceType: 'unambiguous',
// .map files are not generated unless babel invoked with --source-maps
sourceMaps: true,
presets: ['@babel/preset-env', '@babel/preset-react'],
presets: [
'@babel/preset-env',
[
'@babel/preset-react',
{
runtime: 'automatic',
},
],
],
plugins: [
require('@babel/plugin-transform-modules-commonjs'),
require('@babel/plugin-transform-runtime'),
Expand Down
Loading

0 comments on commit b960748

Please sign in to comment.