Skip to content

Commit

Permalink
Update web.md
Browse files Browse the repository at this point in the history
  • Loading branch information
nandorojo authored Sep 19, 2023
1 parent 5af319d commit ab56915
Showing 1 changed file with 13 additions and 22 deletions.
35 changes: 13 additions & 22 deletions docs/docs/web.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,32 +18,23 @@ Install `@expo/webpack-config` to your `devDependencies`:
npm install -D @expo/webpack-config
```

Add this in your `webpack.config.js` file:
Then run `yarn web` and you're done!

## Expo Router / Metro Web

You'll need to add `mjs` to your `sourceExts` in `metro.config.js`. For example:

```js
const createExpoWebpackConfigAsync = require("@expo/webpack-config");
const { getDefaultConfig } = require('expo/metro-config');

module.exports = async function (env, argv) {
const config = await createExpoWebpackConfigAsync(
{
...env,
babel: {
dangerouslyAddModulePathsToTranspile: ["moti"],
},
},
argv
);
config.module.rules.push({
test: /\.mjs$/,
include: /node_modules/,
type: "javascript/auto",
});

return config;
};
```
const config = getDefaultConfig(__dirname);

Then run `yarn web` and you're done!
config.resolver.assetExts.push(
'mjs’
);
module.exports = config;
```
### Troubleshooting
Expand Down

0 comments on commit ab56915

Please sign in to comment.