Skip to content

Instantly share code, notes, and snippets.

@henrikbjorn
Last active July 19, 2018 12:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save henrikbjorn/dfc50687638f9ebfc9a212675eacaff5 to your computer and use it in GitHub Desktop.
Save henrikbjorn/dfc50687638f9ebfc9a212675eacaff5 to your computer and use it in GitHub Desktop.
{
"presets": [
["@babel/preset-env", {
"modules": false,
"useBuiltIns": "entry",
"exclude": [
"transform-regenerator"
],
"targets": {
"ie": "11"
}
}]
],
"env": {
"test": {
"presets": ["env"]
}
}
}
node_modules
_build
yarn-error.log
yarn.lock

Raven

ANALYZE=1 yarn webpack --mode=production

import Raven from "raven-js"
Raven.setup("asda").install()
{
"name": "",
"version": "1.0.0",
"description": "",
"main": "index.js",
"repository": "",
"author": "",
"license": "UNLICENSED",
"private": true,
"devDependencies": {
"@babel/core": "^7.0.0-beta",
"@babel/plugin-proposal-class-properties": "^7.0.0-beta.52",
"@babel/plugin-proposal-object-rest-spread": "^7.0.0-beta",
"@babel/preset-env": "^7.0.0-beta",
"babel-loader": "^8.0.0-beta",
"webpack": "^4.14.0",
"webpack-bundle-analyzer": "^2.13.1",
"webpack-cli": "^3.0.8"
},
"dependencies": {
"raven-js": "^3.17.0"
}
}
var webpack = require('webpack')
var path = require('path')
var NODE_ENV = process.env.NODE_ENV || 'development'
var config = {
entry: [
path.resolve(__dirname, 'main.js'),
],
output: {
filename: 'bundle.js',
chunkFilename: '[name].js',
path: path.resolve(__dirname, '_build'),
publicPath: '/',
},
target: 'web',
module: {
rules: [
{ test: /\.js?$/, exclude: [/node_modules/], loader: 'babel-loader' },
],
},
plugins: [],
}
if (process.env.ANALYZE) {
var AnalyzerPlugin = require('webpack-bundle-analyzer')
config.plugins.push(new AnalyzerPlugin.BundleAnalyzerPlugin())
}
module.exports = config
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment