diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index 99d9eea1..e332cc5b 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -5254,11 +5254,6 @@ } } }, - "electron-is-running-in-asar": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/electron-is-running-in-asar/-/electron-is-running-in-asar-1.0.0.tgz", - "integrity": "sha1-9ufRapejP+R99S4/lUazcBfx+so=" - }, "electron-mocha": { "version": "8.1.2", "resolved": "https://registry.npmjs.org/electron-mocha/-/electron-mocha-8.1.2.tgz", @@ -12142,20 +12137,19 @@ } }, "resin-corvus": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/resin-corvus/-/resin-corvus-2.0.3.tgz", - "integrity": "sha512-EEjZR7EV9KGVDm5conVTmkc6erl6Wzsy/74bAZb0uucRqlRl8NF5TSSFcDLZtEOytzKvJsNmJBNnYsesblMi+g==", + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/resin-corvus/-/resin-corvus-2.0.5.tgz", + "integrity": "sha512-MBoe+22RcF/4wVLsWdDSoJQ9iZOHBzS0WAuX38Gz3Eli49bgRKHh6oLPrdyW6hj5Lnh3nMlKVAMkKolxKIeQtw==", "requires": { "arch": "^2.1.0", "deep-map-keys": "^1.2.0", "detect-process": "^1.0.4", - "electron-is-running-in-asar": "^1.0.0", "flat": "^4.0.0", "json-cycle": "^1.3.0", "lodash": "^4.17.4", "lodash-deep": "^2.0.0", "mixpanel": "^0.10.1", - "mixpanel-browser": "^2.11.0", + "mixpanel-browser": "2.30.1", "os-locale": "^2.0.0", "raven": "^2.2.1", "raven-js": "^3.19.1" @@ -15678,4 +15672,4 @@ } } } -} +} \ No newline at end of file diff --git a/package.json b/package.json index 3ef5d4d3..0bfa07e8 100644 --- a/package.json +++ b/package.json @@ -85,7 +85,7 @@ "redux": "^3.5.2", "rendition": "^11.24.0", "request": "^2.81.0", - "resin-corvus": "^2.0.3", + "resin-corvus": "^2.0.5", "roboto-fontface": "^0.9.0", "semver": "^5.1.1", "styled-components": "^4.2.0", diff --git a/scripts/resin b/scripts/resin index 39270eb2..a921d611 160000 --- a/scripts/resin +++ b/scripts/resin @@ -1 +1 @@ -Subproject commit 39270eb2e5d72652f42f91ccd4cee1a66d41e06e +Subproject commit a921d6118446f2667612fe28c8dd8d8ff30f935e diff --git a/webpack.config.js b/webpack.config.js index 331ab0bd..d1714a91 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -16,10 +16,32 @@ 'use strict' +const _ = require('lodash') const path = require('path') const SimpleProgressWebpackPlugin = require('simple-progress-webpack-plugin') const nodeExternals = require('webpack-node-externals') +/** + * Don't webpack package.json as mixpanel & sentry tokens + * will be inserted in it after webpacking + * + * @param {*} packageJsonPath - Path for the package.json file + * @returns {void} + * + * @example webpack externals: + * [ + * externalPackageJson('./package.json') + * ] + */ +const externalPackageJson = (packageJsonPath) => { + return (_context, request, callback) => { + if (_.endsWith(request, 'package.json')) { + return callback(null, `commonjs ${packageJsonPath}`) + } + return callback() + } +} + const commonConfig = { mode: 'production', optimization: { @@ -61,9 +83,6 @@ const commonConfig = { format: process.env.WEBPACK_PROGRESS || 'verbose' }) ], - externals: [ - nodeExternals() - ], output: { path: path.join(__dirname, 'generated'), filename: '[name].js' @@ -77,6 +96,12 @@ const guiConfig = { __dirname: true, __filename: true }, + externals: [ + nodeExternals(), + + // '../../../package.json' because we are in 'lib/gui/app/index.html' + externalPackageJson('../../../package.json') + ], entry: { gui: path.join(__dirname, 'lib', 'gui', 'app', 'app.js') }, @@ -90,6 +115,12 @@ const etcherConfig = { __dirname: false, __filename: true }, + externals: [ + nodeExternals(), + + // '../package.json' because we are in 'generated/etcher.js' + externalPackageJson('../package.json') + ], entry: { etcher: path.join(__dirname, 'lib', 'start.js') }