Skip to content

Commit

Permalink
First commit
Browse files Browse the repository at this point in the history
  • Loading branch information
sheepzh committed Mar 2, 2021
0 parents commit 781148a
Show file tree
Hide file tree
Showing 26 changed files with 16,291 additions and 0 deletions.
9 changes: 9 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
node_modules

dist_dev

dist_prod

firefox_dev

market_packages
18 changes: 18 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"vetur.format.defaultFormatter.html": "js-beautify-html",
"vetur.format.defaultFormatter.js": "vscode-typescript",
"vetur.format.defaultFormatterOptions": {
"js-beautify-html": {
"wrap_attributes": "force-aligned"
}
},
"editor.tabSize": 4,
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"source.fixAll": true
},
"prettier.eslintIntegration": true,
"prettier.semi": false,
"prettier.singleQuote": true,
"javascript.format.insertSpaceBeforeFunctionParenthesis": true
}
21 changes: 21 additions & 0 deletions doc/for-fire-fox.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
## How to Build for Development
``` shell
npm install
npm run build
```
The output directory is *firefox_dev*

## How to Build for Production

```shell
npm install
npm run build:prod
```

The output directory is *dist_prod* and *market_packages*

## Another

Also you could visit the repository in GitHub

[sheepzh/make-zero](https://github.com/sheepzh/make-zero)
25 changes: 25 additions & 0 deletions env.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/**
* Resolve environment
*
* @since 1.0.0
*/
const path = require('path')
const fs = require('fs')
module.exports = __dirname => {
// Get the env
const argv = process.argv
let env = 'production'
argv.filter(a => a.startsWith('--mode=')).map(a => a.substring(7)).forEach(a => env = a)

// Read env variables
const envVariableFileName = path.join(__dirname, `.env.${env}`)
const data = ''
try {
data = fs.readFileSync(envVariableFileName, { encoding: 'utf8' }).replace(/\r\n/g, ',').replace(/\r/g, ',').replace(/\n/g, ',')
} catch (e) {
console.log('Environment variable file not found: ' + envVariableFileName)
}
const variables = {}
data.split(',').filter(a => !!a.trim() && !a.startsWith('#')).map(item => { return item.split('=') }).forEach(item => { variables[item[0]] = item[1] })
return { env, variables }
}
Loading

0 comments on commit 781148a

Please sign in to comment.