GithubHelp home page GithubHelp logo

hawk.webpack.plugin's Introduction

Hawk Webpack Plugin

Webpack plugin for sending source maps to the Hawk.

Install

yarn add @hawk.so/webpack-plugin --save-dev

Connect

Next you need to connect plugin to the Webpack config.

Pass your Integration Token as plugin option. It is useful to store it in .env file.

const HawkWebpackPlugin = require('@hawk.so/webpack-plugin');

module.exports = {
  // ... other webpack options
  plugins: [
    new HawkWebpackPlugin({
      integrationToken: '' // Your project's Integration Token
    })
  ],
  devtool: 'hidden-source-map',
}

Plugin options:

option required description
integrationToken yes Your project's Integration Token
release no Unique identifier of the release. By default, it will be Webpack compilation hash. You should pass this identifier to the Javascript Catcher on initialization through the release option
releaseInfoFile no The path where release.json file will be created. By default, it will be got from Webpack output.path option. You can pass false to prevent creation of this file (can be useful, if you store and pass release id manually)
removeSourceMaps no Should the plugin to remove emitted source map files. Default is true.
commits no Object with git options for suspected commits. Enabled by default. Can be set to false to not include commits in the release.
Commits options type description
repo string Path to repository with .git directory. Default is __dirname.

After plugin finish its work, it will save release information to the release.json file. You can use this file to get release identifier and pass it to the JavaScript Catcher on initialization.

See example of connection.

Usage in React project

If you want to send source maps of your React project, you need to use react-app-rewired or do yarn eject. Then you can override Webpack config of your project and use this plugin.

hawk.webpack.plugin's People

Contributors

dependabot[bot] avatar geekan2 avatar ilyamore88 avatar nespecc avatar talyguryn avatar

Stargazers

 avatar

Watchers

 avatar  avatar

hawk.webpack.plugin's Issues

Send commits info to collector

In the release information, you must also send a field with information about commits made since the last release for the suspected commits feature to work

[Error] Arrays are not supported

� Hawk | (⌐■_■) Sending static/js/runtime-main.b42d73a9.js.map failed: 

Arrays are not supported.

Error object:

Error: Arrays are not supported.
    at FormData.append (D:\WebStormProjects\test-react-integration\node_modules\form-data\lib\form_data.js:66:17)
    at D:\WebStormProjects\test-react-integration\node_modules\@hawk.so\webpack-plugin\src\index.js:162:14
    at async Promise.all (index 3)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.