Skip to content

Commit

Permalink
next build yeah
Browse files Browse the repository at this point in the history
  • Loading branch information
MoOx committed Nov 27, 2024
1 parent e9ccdca commit 65b5972
Show file tree
Hide file tree
Showing 3 changed files with 79 additions and 5 deletions.
35 changes: 32 additions & 3 deletions next.config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import type { NextConfig } from "next";

import packageJson from "./package.json" with { type: "json" };

const transpilePackages = [
Expand All @@ -9,6 +10,12 @@ const transpilePackages = [
),
];
const nextConfig: NextConfig = {
transpilePackages,

env: {
ENV: process.env.NODE_ENV,
},

experimental: {
turbo: {
rules: {
Expand Down Expand Up @@ -42,10 +49,32 @@ const nextConfig: NextConfig = {
],
},
},
transpilePackages,

env: {
ENV: process.env.NODE_ENV,
webpack: (config, { webpack }) => {
// react-native packages requires often global __DEV__ constant
config.plugins.push(
new webpack.DefinePlugin({
__DEV__: process.env.NODE_ENV === "production" || true,
})
);

// react-native-web
config.resolve.alias = {
...(config.resolve.alias || {}),
// Transform all direct `react-native` imports to `react-native-web`
"react-native$": "react-native-web",
};
config.resolve.extensions = [
".web.js",
".web.ts",
".web.tsx",
...config.resolve.extensions,
];

// avoid duplicated react
// config.resolve.alias['react'] = path.resolve(__dirname, '.', 'node_modules', 'react');

return config;
},
};

Expand Down
48 changes: 46 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
"react": "19.0.0-rc-66855b96-20241106",
"react-dom": "19.0.0-rc-66855b96-20241106",
"react-native-gesture-handler": "^2.21.2",
"react-native-reanimated": "^3.16.3",
"react-native-safe-area-context": "^4.14.0",
"react-native-svg": "^15.9.0",
"react-native-web": "^0.19.13",
Expand Down

0 comments on commit 65b5972

Please sign in to comment.