Skip to content

Commit 48d1edb

Browse files
committed
Fixed bundling no longer working on pre RN 57 versions
1 parent d5ad64c commit 48d1edb

File tree

5 files changed

+31
-29
lines changed

5 files changed

+31
-29
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
"license": "MIT",
1919
"dependencies": {
2020
"babel-loader": "^7.1.4",
21-
"haul": "^1.0.0-rc.4",
21+
"haul": "1.0.0-rc.7",
2222
"webpack-visualizer-plugin": "^0.1.11"
2323
}
2424
}

src/haul.config.extend.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import Visualizer from 'webpack-visualizer-plugin';
2+
import originalConfig from '../../../haul.config.js';
3+
4+
export default {
5+
webpack: env => {
6+
const config = originalConfig.webpack(env);
7+
config.plugins.push(new Visualizer());
8+
return config;
9+
}
10+
};

src/haul.config.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import Visualizer from 'webpack-visualizer-plugin';
2+
import { createWebpackConfig } from "haul";
3+
import { getEntryPoint } from './get-entry-point';
4+
5+
export default {
6+
webpack: env => {
7+
const config = createWebpackConfig({
8+
entry: getEntryPoint(),
9+
})(env);
10+
11+
config.plugins.push(new Visualizer());
12+
13+
return config;
14+
}
15+
};

src/react-native-bundle-visualizer.sh

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
#!/bin/bash
22

33
DIR=./node_modules/react-native-bundle-visualizer/src
4-
CONFIG_FILE=$DIR/webpack.haul.js
4+
CONFIG_FILE=$DIR/haul.config.js
55
if [ -f ./webpack.haul.js ]; then
6-
CONFIG_FILE2=$DIR/webpack.haul.extend.js
6+
CONFIG_FILE=$DIR/webpack.haul.extend.js
7+
fi
8+
if [ -f ./haul.config.js ]; then
9+
CONFIG_FILE=$DIR/haul.config.extend.js
710
fi
811

912
./node_modules/.bin/haul bundle --config $CONFIG_FILE --platform ios

src/webpack.haul.js

Lines changed: 0 additions & 26 deletions
This file was deleted.

0 commit comments

Comments
 (0)