Created
April 5, 2016 19:32
-
-
Save CurtisHumphrey/9c5dfe4852fd58dde5f6b289fb86d131 to your computer and use it in GitHub Desktop.
getsentry switching projects
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- the normal html --> | |
<%= htmlWebpackPlugin.options.raven %> | |
</body> | |
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script src="https://cdn.ravenjs.com/2.3.0/raven.min.js"></script> | |
<script> | |
var prod_host = 'main.com' | |
var prod_path = 'https://##@app.getsentry.com/##' | |
var stage_path = 'https://##@app.getsentry.com/##' | |
var path = (window.location.host === prod_host) ? prod_path : stage_path; | |
Raven.config(path).install() | |
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const childProcess = require('child_process') | |
const VERSION = childProcess.execSync('git describe --tags').toString() | |
const raven_stage = 'https://###@app.getsentry.com/###' | |
const raven_prod = 'https://###@app.getsentry.com/###' | |
const prod_host = 'main.com' | |
let raven | |
if (__PROD__) { | |
debug('Adding Raven for production or stage') | |
raven = ` | |
<script src="https://cdn.ravenjs.com/2.3.0/raven.min.js"></script> | |
<script> | |
var path = (window.location.host === '${prod_host}') ? '${raven_prod}' : '${raven_stage}'; | |
Raven.config(path,{release: '${VERSION}'}).install() | |
</script>` | |
} | |
webpackConfig.plugins.push( | |
new HtmlWebpackPlugin({ | |
template: paths.client('index.esj'), | |
hash: false, | |
favicon: paths.client('static/favicon.ico'), | |
filename: 'index.html', | |
inject: 'body', | |
raven, | |
minify: { | |
collapseWhitespace: true, | |
}, | |
}) | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment