Skip to content

Commit

Permalink
Merge pull request #892 from input-output-hk/feat/lw-9219-nami-produc…
Browse files Browse the repository at this point in the history
…tion-build-command-not-working

[LW-9219] Production build command not working
  • Loading branch information
Lucas authored Dec 7, 2023
2 parents 5071517 + edef1fc commit 551985f
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 4 deletions.
12 changes: 10 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

Nami is a browser based wallet extension to interact with the Cardano blockchain. It's an open-source project and built by [**Berry Pool**](https://pipool.online).


### Testnet

[Download testnet version](./build.zip)
Expand Down Expand Up @@ -213,7 +212,12 @@ The `project_id` for API requests can be created under [blockfrost.io](https://b

**Recommended:** Follow this [approach](https://github.com/lxieyang/chrome-extension-boilerplate-react#secrets) in order to keep the keys seperate from the repository.

The quick solution is to go under `./src/config/provider.js` and replace `secrets.PROJECT_ID_MAINNET` and `secrets.PROJECT_ID_TESTNET` with the project ids from blockfrost.
```
# Update secrets file with your own keys
cp secrets.testing.js secrets.development.js
```

The quick solution is to go under `./src/config/provider.js` and replace `secrets.PROJECT_ID_MAINNET`, `secrets.PROJECT_ID_TESTNET`, `secrets.PROJECT_ID_PREVIEW` and `secrets.PROJECT_ID_PREPROD` with the project ids from blockfrost.

##### Requirements

Expand All @@ -222,12 +226,16 @@ The quick solution is to go under `./src/config/provider.js` and replace `secret
##### Start development server

```
# Update secrets file with your own keys
cp secrets.testing.js secrets.development.js
npm start
```

##### Create production build

```
# Update secrets file with your own keys
cp secrets.testing.js secrets.production.js
npm run build
```

Expand Down
2 changes: 2 additions & 0 deletions secrets.testing.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
export default {
PROJECT_ID_MAINNET: 'DUMMY_MAINNET',
PROJECT_ID_TESTNET: 'DUMMY_TESTNET',
PROJECT_ID_PREVIEW: 'DUMMY_PREVIEW',
PROJECT_ID_PREPROD: 'DUMMY_PREPROD',
};
14 changes: 12 additions & 2 deletions utils/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,16 @@ delete config.chromeExtensionBoilerplate;

config.mode = 'production';

webpack(config, function (err) {
if (err) throw err;
webpack(config, function (err, stats) {
if (stats.hasErrors()) {
console.log(
stats.toString({
colors: true,
})
);
}

if (err) {
throw err;
}
});

0 comments on commit 551985f

Please sign in to comment.