@equinor/opt-dev
TypeScript icon, indicating that this package has built-in type declarations

6.15.0 • Public • Published

@equinor/opt-dev

License Downloads

Release Vulnerabilities

OPT dev tools and cli scripts.

CLI scripts

// package.json
"scripts": {
    "dev": "opt-dev dev",
    "build": "opt-dev build",
    "test": "opt-dev test"
}
opt-dev serve

Runs the application in the development mode.
Open http://localhost:3000 to view it in the browser.

Using the default port but it can be changed it in the .env file

The page will reload if you make edits.
You will also see any lint errors in the console.

opt-dev build

Builds the app for production to the dist folder.
It correctly bundles React in production mode and optimizes the build for the best performance.

The build is minified and the filenames include the hashes.
Your app is ready to production!

opt-dev test

Launches the test runner.

Overriding configurations

Override webpack configuration

To override or extend a webpack configuration simply add a webpack.config.js file into the root of the application folder.

Override eslint configuration

To override or extend the eslint configuration simply add the rules you want to add/modify into the eslint configuration file.

Override prettier configuration

To override or extend the prettier configuration simply add the rules you want to add/modify into the .prettierrc.js file. See more on prettier share configuration.

Keep in mind, that all the new configurations will be merged and replace the base ones.

Required folder structure

You can use this dependency into your own project but, the folder structure must have the next required files:

my-app/
├─ public/              --> [Required folder] static assets that need to be load before the webpack.
├─ server/
│  ├─ index.js          --> [Required file] express server routing point.
├─ src/
│  ├─ index.html        --> [Required file] html template
│  ├─ index.tsx         --> [Required file] Application entry point

The Application entry point or express server routing point doesn't need to be typescript or javascript files, it just need to be a valid file (js, jsx, tsx, etc)

Readme

Keywords

none

Package Sidebar

Install

npm i @equinor/opt-dev

Weekly Downloads

34

Version

6.15.0

License

MIT

Unpacked Size

27 kB

Total Files

18

Last publish

Collaborators

  • sindremohr
  • spcttre
  • sbeno