2017-12-12 19:24:01 -07:00
|
|
|
const path = require("path");
|
2017-12-13 12:51:23 -07:00
|
|
|
const fs = require("fs");
|
|
|
|
var SentryPlugin = require("webpack-sentry-plugin");
|
2017-12-12 19:24:01 -07:00
|
|
|
|
|
|
|
module.exports = function override(config, env) {
|
|
|
|
config.module.rules.push({
|
|
|
|
test: /worker\.js$/,
|
|
|
|
include: path.resolve("./src"),
|
|
|
|
use: [{ loader: "worker-loader" }, { loader: "babel-loader" }]
|
|
|
|
});
|
|
|
|
|
2017-12-13 12:51:23 -07:00
|
|
|
config.module.rules.push({
|
|
|
|
test: /\.(js|jsx)$/,
|
|
|
|
include: path.resolve(
|
|
|
|
fs.realpathSync(process.cwd()),
|
|
|
|
"node_modules/streamsaver"
|
|
|
|
),
|
|
|
|
use: { loader: "babel-loader" }
|
|
|
|
});
|
|
|
|
|
|
|
|
if (env === "production") {
|
|
|
|
config.plugins.push(
|
|
|
|
new SentryPlugin({
|
|
|
|
organisation: "commaai",
|
|
|
|
project: "cabana",
|
|
|
|
apiKey:
|
|
|
|
"7a932ab144984dd3979993cf61dbdd2a1489ac77af4d4f46b85d64598b9a4ca6",
|
|
|
|
release: function(hash) {
|
2017-12-13 14:44:33 -07:00
|
|
|
return process.env.COMMIT_REF + ";" + hash; // webpack build hash
|
2017-12-13 12:51:23 -07:00
|
|
|
}
|
|
|
|
})
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
2017-12-12 19:24:01 -07:00
|
|
|
return config;
|
|
|
|
};
|