Skip to content

Commit

Permalink
chore(deps): sync with nu, update with react18
Browse files Browse the repository at this point in the history
  • Loading branch information
JulianWielga committed Aug 11, 2024
1 parent 32fda4a commit 6390fb4
Show file tree
Hide file tree
Showing 8 changed files with 3,134 additions and 1,843 deletions.
29 changes: 17 additions & 12 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
{
"only": [
"src/**/*",
"jest.setup.js"
],
"presets": [
"@babel/preset-env",
"@babel/typescript",
[
"@babel/preset-env",
"@babel/preset-react",
{
"loose": true
"runtime": "automatic"
}
],
"@babel/typescript",
"@babel/preset-react"
]
],
"plugins": [
[
Expand All @@ -16,12 +20,13 @@
"legacy": true
}
],
[
"@babel/plugin-proposal-class-properties",
{
"loose": true
}
],
"@babel/plugin-transform-runtime"
]
],
"env": {
"development": {
"plugins": [
"react-refresh/babel"
]
}
}
}
5 changes: 4 additions & 1 deletion configs/webpack/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,9 @@ export const commonConfig: Configuration = {
},
],
},
entry: ["./src/index.ts"],
entry: {
main: "./src/index.ts",
},
plugins: [
new MomentLocalesPlugin({
localesToKeep: ["en"],
Expand All @@ -116,6 +118,7 @@ export const commonConfig: Configuration = {
new HtmlWebpackPlugin({
title: `${pkg.name} ${pkg.version}`,
publicPath: "/",
chunks: ["runtime", "main"],
}),
new CopyPlugin({
patterns: [
Expand Down
28 changes: 6 additions & 22 deletions configs/webpack/dev.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,13 @@ export const devConfig = mergeWithRules({
})(commonConfig, {
mode: "development",
devServer: {
client: {
overlay: false,
},
host: "0.0.0.0",
port: 7890,
hot: true, // enable HMR on the server
hot: true,
allowedHosts: "all",
historyApiFallback: {
disableDotRule: true,
},
Expand All @@ -40,32 +44,12 @@ export const devConfig = mergeWithRules({
},
},
},
devtool: "eval-cheap-module-source-map",
optimization: {
moduleIds: "named",
chunkIds: "named",
},
devtool: "eval-source-map",
plugins: [
new ReactRefreshWebpackPlugin({
overlay: false,
}),
],
module: {
rules: [
{
test: /\.[jt]sx?$/,
exclude: /node_modules/,
use: [
{
loader: "babel-loader",
options: {
plugins: [require.resolve("react-refresh/babel")],
},
},
],
},
],
},
});

export default devConfig;
Loading

0 comments on commit 6390fb4

Please sign in to comment.