Commit a9df7d86 authored by Mike Greiling's avatar Mike Greiling

Remove babel-plugin-transform-define dependency

parent 1efed5d3
......@@ -28,12 +28,6 @@
"exclude": ["spec/javascripts/**/*", "app/assets/javascripts/locale/**/app.js"]
}
],
[
"babel-plugin-transform-define",
{
"process.env.BABEL_ENV": "coverage"
}
],
"babel-plugin-rewire"
]
}
......
......@@ -6,7 +6,6 @@ const argumentsParser = require('commander');
const webpackConfig = require('./webpack.config.js');
const ROOT_PATH = path.resolve(__dirname, '..');
const GENERATE_COVERAGE_REPORT = process.env.BABEL_ENV === 'coverage' || process.env.NODE_ENV === 'coverage';
function fatalError(message) {
console.error(chalk.red(`\nError: ${message}\n`));
......@@ -24,7 +23,11 @@ webpackConfig.optimization.splitChunks = false;
webpackConfig.devtool = 'cheap-inline-source-map';
webpackConfig.plugins.push(
new webpack.DefinePlugin({ GENERATE_COVERAGE_REPORT }),
new webpack.DefinePlugin({
'process.env': {
BABEL_ENV: JSON.stringify(process.env.BABEL_ENV || process.env.NODE_ENV || null),
},
})
);
const specFilters = argumentsParser
......@@ -89,7 +92,7 @@ module.exports = function(config) {
basePath: ROOT_PATH,
browsers: ['ChromeHeadlessCustom'],
client: {
color: !process.env.CI
color: !process.env.CI,
},
customLaunchers: {
ChromeHeadlessCustom: {
......@@ -123,7 +126,7 @@ module.exports = function(config) {
};
}
if (GENERATE_COVERAGE_REPORT) {
if (process.env.BABEL_ENV === 'coverage' || process.env.NODE_ENV === 'coverage') {
karmaConfig.reporters.push('coverage-istanbul');
karmaConfig.coverageIstanbulReporter = {
reports: ['html', 'text-summary'],
......
......@@ -155,7 +155,7 @@ describe('test errors', () => {
// if we're generating coverage reports, make sure to include all files so
// that we can catch files with 0% coverage
// see: https://github.com/deepsweet/istanbul-instrumenter-loader/issues/15
if (GENERATE_COVERAGE_REPORT) { // eslint-disable-line no-undef
if (process.env.BABEL_ENV === 'coverage') {
// exempt these files from the coverage report
const troubleMakers = [
'./blob_edit/blob_bundle.js',
......
......@@ -1055,13 +1055,6 @@ babel-plugin-rewire@^1.2.0:
version "1.2.0"
resolved "https://registry.yarnpkg.com/babel-plugin-rewire/-/babel-plugin-rewire-1.2.0.tgz#822562d72ed2c84e47c0f95ee232c920853e9d89"
babel-plugin-transform-define@^1.3.0:
version "1.3.0"
resolved "https://registry.yarnpkg.com/babel-plugin-transform-define/-/babel-plugin-transform-define-1.3.0.tgz#94c5f9459c810c738cc7c50cbd44a31829d6f319"
dependencies:
lodash "4.17.4"
traverse "0.6.6"
babel-polyfill@6.23.0:
version "6.23.0"
resolved "https://registry.yarnpkg.com/babel-polyfill/-/babel-polyfill-6.23.0.tgz#8364ca62df8eafb830499f699177466c3b03499d"
......@@ -4461,10 +4454,6 @@ lodash.upperfirst@4.3.1:
version "4.3.1"
resolved "https://registry.yarnpkg.com/lodash.upperfirst/-/lodash.upperfirst-4.3.1.tgz#1365edf431480481ef0d1c68957a5ed99d49f7ce"
lodash@4.17.4:
version "4.17.4"
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.4.tgz#78203a4d1c328ae1d86dca6460e369b57f4055ae"
lodash@^4.11.1, lodash@^4.17.10, lodash@^4.17.4, lodash@^4.17.5, lodash@^4.3.0, lodash@^4.5.0:
version "4.17.11"
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.11.tgz#b39ea6229ef607ecd89e2c8df12536891cac9b8d"
......@@ -6643,10 +6632,6 @@ touch@^3.1.0:
dependencies:
nopt "~1.0.10"
traverse@0.6.6:
version "0.6.6"
resolved "https://registry.yarnpkg.com/traverse/-/traverse-0.6.6.tgz#cbdf560fd7b9af632502fed40f918c157ea97137"
trim-right@^1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/trim-right/-/trim-right-1.0.1.tgz#cb2e1203067e0c8de1f614094b9fe45704ea6003"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment