Commit Graph

13 Commits

Author SHA1 Message Date
Daniel Lockyer
314281cf08
Removed extraneous logging from Portal dev script
refs https://github.com/TryGhost/Toolbox/issues/426

- now Portal is in the monorepo, the dev script doesn't need to wipe the
  console output nor print instructions as that should be handled with
  setting environment variables
2022-10-05 15:13:34 +07:00
Rishabh
f56269933e Updated default port used in dev mode
refs https://developer.apple.com/forums/thread/682332

Mac OS Monterey by default listens on ports 5000 and 7000 for new AirPlay functionality. Since portal dev mode also runs on port 5000 and gets blocked due to this, the default port is now updated to use 5368 instead.

Note: Its still possible to choose a different port while starting portal in dev mode by running `yarn start:dev --port=xxxx`
2021-11-02 10:15:35 +05:30
Rishabh
c7a3fdc639 Added access control header for start mode
no refs

- since portal script is loaded with `crossorigin:anonymous` now, we need to pass in the access control headers for script to bypass cors check
2021-06-22 17:07:14 +05:30
Rishabh
8d5f5febaa Added access control headers in dev mode
no refs

- adds `access-control-allow-origin: *` headers for dev mode
- portal script will be loaded with `cross-origin=anonymous`, access control header is needed to allow script to load
- mimics unpkg which already adds `access-control-allow-origin: *`
2021-06-22 12:16:49 +05:30
Rishabh
885fe178dd Updated local start mode script
no issues

- adds new start-combined script which combines all chunks in `yarn start` for local portal development
- allows easier loading of local portal bundle in ghost via load-portal script, which needs to inject single script
- updates `yarn start:dev` to use updated script which uses the combined mode for better local development

refs
https://gist.github.com/simpixelated/90a3c16c3ed268fe24f5e5c9585ced2f
2021-06-16 20:58:44 +05:30
Rishabh
6e2952901a Updated Portal build script to use rewired webpack config
no issues

- updates Portal build script to use rewired react-scripts config
- updated config handles css embed as well as output location/name for portal bundle as part of cra build
- makes extra webpack bundling redundant for now
- updates dev mode to map the portal source map useful for testing build version locally
- updates custom webpack config with copy plugin for future use

refs -
https://github.com/facebook/create-react-app/issues/5306#issuecomment-603772477
https://gist.github.com/phdesign/3fd306db2bc53f6368e6f0f73bbeff19
2021-06-16 20:58:44 +05:30
Rishabh
7c5cb61ee5 Updated Ghost config URL for dev mode script
no refs

- updates portal url for Ghost config to use a dynamic URL to work same as start mode script
2021-06-16 20:58:44 +05:30
Rishabh
a4afeba183 Updated dev mode script to serve on static URL
no refs

- adds static serve path for portal dev mode script same as start mode
2021-06-11 19:55:43 +05:30
Rishabh
f0ba337659 Cleaned dev mode script
no refs

Cleans up dev mode script for lint errors
2021-06-10 15:05:33 +05:30
Rishabh
47c6509bea Added experimental start mode script for local development
no refs

Adds a new `yarn start:dev` command to start portal in development mode that allows development script to be used directly on Ghost site without needing a build for each change. Allows faster development on Portal locally.
2021-06-10 15:05:08 +05:30
Rishabh
0b2af14567 Added dev script for Portal development
no refs

The new dev script allows running `yarn dev` on the Portal code to make Portal development easier as well as integrate more easily with Ghost config. The script runs a local development server that serves portal bundle, which allows for static `portal` config to be used in Ghost for pointing to Portal script. It also watches the files for any changes, and auto re-builds and bundles latest Portal code.
2021-06-07 14:22:31 +05:30
Rish
0ff2f9df9e Fixed lint in build script
no issue
2020-06-07 01:26:58 +05:30
Rish
c23a80e6f0 Updated build process for single minified script
no issue

By default, CRAs build process creates chunked script files and adds them to default index.html. The updated build process uses `rewire` and `webpack` to -

- Tweak CRAs default behavior by switching off chunking, which leads to a single script
- Uses webpack locally to combine JS and CSS built by above step into a single `bundle.min.js`
2020-03-24 18:49:04 +05:30