Skip to content

Commit 96ad597

Browse files
committed
fix: fix running expo example on web
1 parent b681c8a commit 96ad597

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed

templates/common/$package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
"module": "lib/module/index.js",
77
"types": "lib/typescript/src/index.d.ts",
88
"react-native": "src/index.tsx",
9+
"source": "src/index.tsx",
910
"files": [
1011
"src",
1112
"lib",
@@ -81,6 +82,7 @@
8182
"prettier/prettier": [
8283
"error",
8384
{
85+
"quoteProps": "consistent",
8486
"singleQuote": true,
8587
"tabWidth": 2,
8688
"trailingComma": "es5",
@@ -91,6 +93,7 @@
9193
},
9294
"eslintIgnore": ["node_modules/", "lib/"],
9395
"prettier": {
96+
"quoteProps": "consistent",
9497
"singleQuote": true,
9598
"tabWidth": 2,
9699
"trailingComma": "es5",

templates/expo-library/example/webpack.config.js

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
const path = require('path');
22
const createExpoWebpackConfigAsync = require('@expo/webpack-config');
33

4+
const root = path.resolve(__dirname, '..');
5+
const node_modules = path.resolve(__dirname, 'node_modules');
6+
47
module.exports = async function(env, argv) {
58
const config = await createExpoWebpackConfigAsync(env, argv);
69

@@ -11,11 +14,11 @@ module.exports = async function(env, argv) {
1114
});
1215

1316
Object.assign(config.resolve.alias, {
14-
react: path.resolve(__dirname, 'node_modules', 'react'),
15-
'react-native-web': path.resolve(
16-
__dirname,
17-
'node_modules',
18-
'react-native-web'
17+
'react': path.join(node_modules, 'react'),
18+
'react-native-web': path.join(node_modules, 'react-native-web'),
19+
'<%= project.slug %>': path.join(
20+
root,
21+
require('../package.json').source
1922
),
2023
});
2124

0 commit comments

Comments
 (0)