switch config.json based on NODE_ENV
This commit is contained in:
parent
4f06a2639e
commit
b23d99ffe8
4 changed files with 9 additions and 3 deletions
3
.gitignore
vendored
3
.gitignore
vendored
|
@ -1,4 +1,5 @@
|
|||
node_modules
|
||||
dist
|
||||
wrangler.*
|
||||
config.json
|
||||
config.json
|
||||
config.prod.json
|
|
@ -7,7 +7,7 @@
|
|||
"build": "webpack",
|
||||
"dev": "wrangler -c wrangler.dev.toml dev",
|
||||
"publish-dev": "wrangler -c wrangler.dev.toml publish",
|
||||
"publish-prod": "wrangler -c wrangler.prod.toml publish",
|
||||
"publish-prod": "NODE_ENV=production wrangler -c wrangler.prod.toml publish",
|
||||
"test": "echo \"Error: no test specified\" && exit 1"
|
||||
},
|
||||
"author": "PeterCxy",
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import config from "../config.json"
|
||||
import config from "config"
|
||||
import * as crypto from "./crypto"
|
||||
import S3 from "./aws/s3"
|
||||
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
const path = require('path')
|
||||
const { config } = require('process')
|
||||
|
||||
module.exports = {
|
||||
entry: './src/index.coffee',
|
||||
|
@ -10,6 +11,10 @@ module.exports = {
|
|||
resolve: {
|
||||
extensions: ['.coffee', '.js'],
|
||||
fallback: { "os": false },
|
||||
alias: {
|
||||
config: path.resolve(__dirname,
|
||||
process.env.NODE_ENV == "production" ? "config.prod.json" : "config.json")
|
||||
}
|
||||
},
|
||||
module: {
|
||||
rules: [
|
||||
|
|
Loading…
Add table
Reference in a new issue