Not crashing when not supplying push-data thingies
This commit is contained in:
8
config/env/push.js
vendored
Normal file
8
config/env/push.js
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
try {
|
||||
module.exports = require("./push.config");
|
||||
} catch (e) {
|
||||
console.error(
|
||||
"You haven't defined push-parameters, you sure you want to continue without them?"
|
||||
);
|
||||
module.exports = { publicKey: false, privateKey: false, mailto: false };
|
||||
}
|
||||
@@ -42,7 +42,7 @@ const ServiceWorkerConfig = {
|
||||
plugins: [
|
||||
new webpack.DefinePlugin({
|
||||
__DATE__: new Date().getTime(),
|
||||
__PUBLICKEY__: JSON.stringify(require("./env/push.config").publicKey)
|
||||
__PUBLICKEY__: JSON.stringify(require("./env/push").publicKey)
|
||||
})
|
||||
]
|
||||
};
|
||||
|
||||
@@ -78,7 +78,8 @@ const webpackConfig = function(isDev) {
|
||||
__PRICE__: env.price,
|
||||
__MESSAGE__: JSON.stringify(env.message),
|
||||
__DATE__: env.date,
|
||||
__HOURS__: env.hours
|
||||
__HOURS__: env.hours,
|
||||
__PUSHENABLED__: JSON.stringify(require("./env/push") != false)
|
||||
})
|
||||
]
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user