mirror of
https://github.com/zhigang1992/wallet.git
synced 2026-04-27 22:41:07 +08:00
refactor: attempt removing babel
This commit is contained in:
24
.babelrc.js
24
.babelrc.js
@@ -1,24 +0,0 @@
|
||||
module.exports = api => {
|
||||
api.cache(true);
|
||||
return {
|
||||
presets: [
|
||||
'@babel/preset-typescript',
|
||||
['@babel/preset-env', { targets: { browsers: 'last 2 versions' } }],
|
||||
[
|
||||
'@babel/preset-react',
|
||||
{
|
||||
runtime: 'automatic',
|
||||
importSource: '@emotion/react',
|
||||
},
|
||||
],
|
||||
],
|
||||
plugins: [
|
||||
'@emotion',
|
||||
['@babel/plugin-proposal-class-properties', { loose: false }],
|
||||
'@babel/plugin-transform-runtime',
|
||||
'@babel/plugin-proposal-nullish-coalescing-operator',
|
||||
'@babel/plugin-proposal-optional-chaining',
|
||||
process.env.NODE_ENV === 'development' && require.resolve('react-refresh/babel'),
|
||||
].filter(Boolean),
|
||||
};
|
||||
};
|
||||
@@ -42,7 +42,6 @@ module.exports = {
|
||||
testMatch: ['**/?(*.)+(spec).(js|ts|tsx)'],
|
||||
testRunner: 'jest-circus/runner',
|
||||
transform: {
|
||||
'^.+\\.tsx?$': 'babel-jest',
|
||||
'^.+\\.(j|t)sx?$': '@swc-node/jest',
|
||||
},
|
||||
cacheDirectory: '<rootDir>/.jest-cache',
|
||||
|
||||
43
package.json
43
package.json
@@ -211,14 +211,6 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"@actions/core": "1.9.1",
|
||||
"@babel/core": "7.20.5",
|
||||
"@babel/plugin-proposal-class-properties": "7.18.6",
|
||||
"@babel/plugin-transform-regenerator": "7.20.5",
|
||||
"@babel/plugin-transform-runtime": "7.19.6",
|
||||
"@babel/preset-env": "7.20.2",
|
||||
"@babel/preset-react": "7.18.6",
|
||||
"@babel/preset-typescript": "7.18.6",
|
||||
"@babel/runtime": "7.20.6",
|
||||
"@emotion/babel-preset-css-prop": "11.10.0",
|
||||
"@emotion/cache": "11.10.5",
|
||||
"@playwright/test": "1.28.0",
|
||||
@@ -230,8 +222,8 @@
|
||||
"@stacks/eslint-config": "1.0.10",
|
||||
"@stacks/prettier-config": "0.0.10",
|
||||
"@stacks/stacks-blockchain-api-types": "0.65.0",
|
||||
"@swc-node/jest": "1.5.3",
|
||||
"@swc/core": "1.3.3",
|
||||
"@swc-node/jest": "1.5.5",
|
||||
"@swc/core": "1.3.23",
|
||||
"@testing-library/react": "12.0.0",
|
||||
"@testing-library/react-hooks": "7.0.1",
|
||||
"@testing-library/user-event": "13.1.9",
|
||||
@@ -247,7 +239,7 @@
|
||||
"@types/jest-dev-server": "5.0.0",
|
||||
"@types/jsdom": "16.2.14",
|
||||
"@types/just-debounce-it": "1.5.0",
|
||||
"@types/lodash.get": "4.4.6",
|
||||
"@types/lodash.get": "4.4.7",
|
||||
"@types/node": "17.0.2",
|
||||
"@types/object-hash": "2.2.1",
|
||||
"@types/prismjs": "1.16.6",
|
||||
@@ -268,25 +260,24 @@
|
||||
"@types/webpack-dev-server": "4.5.0",
|
||||
"@types/zxcvbn": "4.4.1",
|
||||
"audit-ci": "6.3.0",
|
||||
"babel-loader": "9.1.0",
|
||||
"base64-loader": "1.0.0",
|
||||
"bip39": "3.0.4",
|
||||
"blns": "2.0.4",
|
||||
"browserslist": "4.19.1",
|
||||
"browserslist": "4.21.4",
|
||||
"chrome-webstore-upload-cli": "1.2.1",
|
||||
"clean-webpack-plugin": "4.0.0",
|
||||
"concurrently": "7.4.0",
|
||||
"concurrently": "7.6.0",
|
||||
"conventional-changelog-conventionalcommits": "5.0.0",
|
||||
"copy-webpack-plugin": "11.0.0",
|
||||
"cross-env": "7.0.3",
|
||||
"crypto-browserify": "3.12.0",
|
||||
"deepmerge": "4.2.2",
|
||||
"dependency-cruiser": "11.15.0",
|
||||
"dependency-cruiser": "12.1.1",
|
||||
"dotenv-webpack": "8.0.1",
|
||||
"esbuild": "0.16.9",
|
||||
"esbuild-loader": "2.20.0",
|
||||
"eslint-plugin-deprecation": "1.2.1",
|
||||
"eslint-plugin-react-hooks": "4.3.0",
|
||||
"eslint-plugin-deprecation": "1.3.3",
|
||||
"eslint-plugin-react-hooks": "4.6.0",
|
||||
"file-loader": "6.2.0",
|
||||
"generate-json-webpack-plugin": "2.0.0",
|
||||
"html-webpack-plugin": "5.5.0",
|
||||
@@ -296,11 +287,11 @@
|
||||
"jest-dev-server": "6.0.0",
|
||||
"msw": "0.31.0",
|
||||
"playwright": "1.28.0",
|
||||
"prettier": "2.7.1",
|
||||
"prettier": "2.8.1",
|
||||
"process": "0.11.10",
|
||||
"progress-bar-webpack-plugin": "2.1.0",
|
||||
"react-dev-utils": "12.0.0",
|
||||
"react-refresh": "0.11.0",
|
||||
"react-dev-utils": "12.0.1",
|
||||
"react-refresh": "0.14.0",
|
||||
"react-test-renderer": "17.0.2",
|
||||
"redux-devtools-extension": "2.13.9",
|
||||
"schema-inspector": "2.0.1",
|
||||
@@ -312,15 +303,15 @@
|
||||
"ts-node": "10.9.1",
|
||||
"ts-unused-exports": "7.0.3",
|
||||
"tsconfig-paths-webpack-plugin": "4.0.0",
|
||||
"typescript": "4.8.2",
|
||||
"typescript": "4.9.4",
|
||||
"vm-browserify": "1.1.2",
|
||||
"web-ext": "7.2.0",
|
||||
"web-ext-submit": "7.2.0",
|
||||
"webpack": "5.74.0",
|
||||
"webpack-bundle-analyzer": "4.6.1",
|
||||
"webpack-cli": "4.10.0",
|
||||
"webpack-dev-server": "4.10.1",
|
||||
"webpack-hot-middleware": "2.25.2"
|
||||
"webpack": "5.75.0",
|
||||
"webpack-bundle-analyzer": "4.7.0",
|
||||
"webpack-cli": "5.0.1",
|
||||
"webpack-dev-server": "4.11.1",
|
||||
"webpack-hot-middleware": "2.25.3"
|
||||
},
|
||||
"resolutions": {
|
||||
"**/**/prismjs": "1.27.0",
|
||||
|
||||
@@ -124,24 +124,6 @@ const config = {
|
||||
test: /\.(ts|tsx)?$/,
|
||||
exclude: /node_modules/,
|
||||
use: [
|
||||
{
|
||||
loader: 'babel-loader',
|
||||
options: {
|
||||
cacheDirectory: true,
|
||||
babelrc: false,
|
||||
presets: [
|
||||
['@babel/preset-env', { targets: { browsers: 'last 2 versions' } }],
|
||||
'@babel/preset-typescript',
|
||||
'@babel/preset-react',
|
||||
],
|
||||
plugins: [
|
||||
['@babel/plugin-proposal-class-properties', { loose: false }],
|
||||
'@babel/plugin-transform-runtime',
|
||||
'@babel/plugin-proposal-nullish-coalescing-operator',
|
||||
'@babel/plugin-proposal-optional-chaining',
|
||||
],
|
||||
},
|
||||
},
|
||||
{
|
||||
loader: 'esbuild-loader',
|
||||
options: {
|
||||
|
||||
@@ -76,6 +76,7 @@ const aliases = {
|
||||
'@stacks/wallet-sdk': '@stacks/wallet-sdk/dist/esm',
|
||||
'lottie-web': path.resolve('node_modules/lottie-web/build/player/lottie_light.js'),
|
||||
};
|
||||
|
||||
const config = {
|
||||
entry: {
|
||||
background: path.join(SRC_ROOT_PATH, 'background', 'background.ts'),
|
||||
@@ -218,7 +219,7 @@ const config = {
|
||||
],
|
||||
};
|
||||
|
||||
module.exports = smp.wrap(config);
|
||||
module.exports = config;
|
||||
|
||||
if (IS_PROD) {
|
||||
module.exports.plugins.push(
|
||||
|
||||
Reference in New Issue
Block a user