Skip to content

Commit

Permalink
chore: added Direct Demo opening into browser (#123)
Browse files Browse the repository at this point in the history
  • Loading branch information
manideepk90 authored Nov 21, 2024
1 parent 5e9a5f4 commit df94707
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 0 deletions.
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"re:start": "rescript build -w",
"re:format": "rescript format -all",
"web": "webpack serve --mode=development --config reactNativeWeb/webpack.config.js",
"web:demo" : "concurrently \" yarn web\" \" webpack server --mode=development --config reactNativeWeb/DemoApp/webpack.config.js\" ",
"ios": "cd ios && rm -rf build && pod install && cd .. && react-native run-ios",
"android": "react-native run-android --appIdSuffix demoapp --main-activity .demoapp.MainActivity && yarn run adb",
"web:next": "cd reactNativeWeb && next",
Expand Down Expand Up @@ -74,6 +75,7 @@
"babel-loader": "^9.1.3",
"babel-plugin-react-native-web": "^0.18.12",
"bufferutil": "^4.0.8",
"concurrently": "^9.0.1",
"cors": "^2.8.5",
"cross-env": "^7.0.3",
"cz-conventional-changelog": "^3.3.0",
Expand Down
37 changes: 37 additions & 0 deletions reactNativeWeb/DemoApp/webpack.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
const path = require('path');
const webpack = require('webpack');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const appDirectory = path.resolve(__dirname);

module.exports = {
entry: {
app: path.join(__dirname, 'DemoAppIndex.js'),
},
output: {
path: path.resolve(appDirectory, 'dist'),
publicPath: '/',
filename: 'index.bundle.js',
},
devtool: 'source-map',
devServer: {
open: true,
port: 8082, // Specify the port here
},
resolve: {
extensions: [
'.web.tsx',
'.web.ts',
'.tsx',
'.ts',
'.web.bs.js',
'.bs.js',
'.web.js',
'.js',
],
},
plugins: [
new HtmlWebpackPlugin({
template : path.join(__dirname, "DemoAppIndex.html")
}),
]
};

0 comments on commit df94707

Please sign in to comment.