-
Notifications
You must be signed in to change notification settings - Fork 63
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(webpack): rely on plugin-core (#1211)
- Loading branch information
1 parent
eaa786c
commit 6730df8
Showing
17 changed files
with
370 additions
and
1,090 deletions.
There are no files selected for viewing
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
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
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
const Honeybadger = require('@honeybadger-io/js'); | ||
|
||
Honeybadger.configure({ | ||
apiKey: process.env.HONEYBADGER_API_KEY, | ||
revision: process.env.HONEYBADGER_REVISION, | ||
}) | ||
|
||
export default Honeybadger |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,35 @@ | ||
const path = require('path'); | ||
const path = require('path') | ||
const HoneybadgerSourceMapPlugin = require('@honeybadger-io/webpack') | ||
const { EnvironmentPlugin } = require('webpack') | ||
|
||
module.exports = { | ||
entry: './src/index.js', | ||
// Entry here would normally just be the `index.js` file, however | ||
// adding multiple entry points generates multiple output files, | ||
// allowing us to test multiple source map uploads | ||
entry: { | ||
index: './src/index.js', | ||
hb: './src/hb.js', | ||
}, | ||
mode: 'production', | ||
output: { | ||
filename: 'index.js', | ||
filename: '[name].bundle.js', | ||
path: path.resolve(__dirname, 'dist'), | ||
}, | ||
devtool: 'source-map', | ||
plugins: [new HoneybadgerSourceMapPlugin({ | ||
apiKey: process.env.HONEYBADGER_API_KEY, | ||
assetsUrl: 'https://cdn.example.com/assets', | ||
revision: 'main', | ||
deploy: true | ||
})] | ||
plugins: [ | ||
new HoneybadgerSourceMapPlugin({ | ||
apiKey: process.env.HONEYBADGER_API_KEY, | ||
// assetsUrl would normally be a url where your assets are hosted | ||
// This is just to test locally, so it's a folder path instead | ||
assetsUrl: '*/dist', | ||
revision: process.env.HONEYBADGER_REVISION, | ||
deploy: { | ||
environment: 'test', | ||
localUsername: 'hbTestUser', | ||
} | ||
}), | ||
// Be aware that if you use EnvironmentPlugin, the values of those env variables | ||
// get bundled into your code as strings. | ||
new EnvironmentPlugin(['HONEYBADGER_API_KEY', 'HONEYBADGER_REVISION']) | ||
] | ||
}; |
Oops, something went wrong.