New Meteor Config for codesandbox.io

Hi, we’ve updated the config to run Meteor in Codesandbox.

You can check the template here.

This example is using React but the same setup should work for other frontend technologies.

The important parts are the scripts for preinstall and start in package.json.

{
  "name": "meteor-react",
  "private": true,
  "scripts": {
    "preinstall": "npm install -g meteor",
    "start": "ROOT_URL=$SANDBOX_URL LANG=C LC_ALL=C $HOME/.meteor/meteor run --exclude-archs web.browser.legacy,web.cordova",
  },
  "dependencies": {
    "@babel/runtime": "^7.16.0",
    "meteor-node-stubs": "^1.1.0",
    "react": "^17.0.2",
    "react-dom": "^17.0.2"
  },
  "meteor": {
    "mainModule": {
      "client": "client/main.jsx",
      "server": "server/main.js"
    },
    "testModule": "tests/main.js"
  },
  "keywords": ["meteorjs", "react"],
  "description": ""
}

If you fork it and improve it somehow please share with us.

Also feel free to provide feedback if something is not working correctly in the sandbox.

10 Likes