Skip to content

Commit

Permalink
added dotenv for custom configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
hLudde committed May 30, 2019
1 parent ab38f6e commit d3210a6
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 2 deletions.
2 changes: 2 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
MEMORY_SIZE=0xFFFF
START_POINT=0x0100
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
# Introduction

Hi, this is a very early WIP emulator for the gameboy handheld system, it is not gona be perfect, and is just a project i am working on own my own currently.

# how to build and run

Clone the project to a folder, open a terminal in the folder and type `npm install`

Configure the `.env.example` file as you want it or leave it as default

Rename the `.env.example` to `.env`

After npm has done its thing, you can run the tests if you feel like with `npm test`

Build the project with `npx webpack`
Expand Down
10 changes: 9 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
"private": true,
"scripts": {
"build": "webpack",
"test": "jest --coverage"
"test": "jest --config ./tests/jest.config.js",
"code-coverage": "jest --coverage"
},
"keywords": [
"gameboy",
Expand All @@ -16,6 +17,7 @@
"license": "ISC",
"devDependencies": {
"@types/jest": "^24.0.13",
"dotenv": "^8.0.0",
"jest": "^24.8.0",
"webpack": "^4.32.2",
"webpack-cli": "^3.3.2"
Expand Down
7 changes: 7 additions & 0 deletions tests/jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
require('dotenv').config();
/*{
module.exports = {
"collectCoverage": true,
"coverageReporters": ["text"],
}
}*/
7 changes: 7 additions & 0 deletions webpack.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
const webpack = require('webpack');
const dotenv = require('dotenv').config({path: __dirname+'/.env'});
module.exports = {
plugins: [
new webpack.DefinePlugin({"process.env": dotenv.parsed})
]
};

0 comments on commit d3210a6

Please sign in to comment.