@flareapp/flare-webpack-plugin-sourcemap
Advanced tools
Comparing version 1.0.7 to 1.0.9
@@ -31,4 +31,8 @@ (function (factory) { | ||
}).apply(compiler); | ||
var isWebpack3 = !compiler.hooks; | ||
var plugin = function (compilation) { | ||
if (!_this.verifyOptions(compiler, compilation)) { | ||
if (isWebpack3) { | ||
return; | ||
} | ||
return Promise.reject(); | ||
@@ -45,8 +49,7 @@ } | ||
}; | ||
if (!compiler.hooks) { | ||
// webpack 3 | ||
if (isWebpack3) { | ||
compiler.plugin('after-emit', plugin); | ||
return; | ||
} | ||
// webpack >4 | ||
// webpack >=4 | ||
compiler.hooks.afterEmit.tapPromise('GetSourcemapsAndUploadToFlare', plugin); | ||
@@ -59,3 +62,4 @@ }; | ||
} | ||
if (!this.runInDevelopment && compiler.options.mode === 'development') { | ||
if ((!this.runInDevelopment && compiler.options.mode === 'development') || | ||
process.env.NODE_ENV === 'development') { | ||
util_1.flareLog('Running webpack in development mode, not uploading sourcemaps to Flare.'); | ||
@@ -62,0 +66,0 @@ return false; |
{ | ||
"name": "@flareapp/flare-webpack-plugin-sourcemap", | ||
"version": "1.0.7", | ||
"version": "1.0.9", | ||
"main": "dist", | ||
@@ -8,3 +8,4 @@ "license": "MIT", | ||
"watch": "tsc --w -noEmit", | ||
"build": "tsc" | ||
"build": "tsc", | ||
"prepublishOnly": "$npm_execpath build" | ||
}, | ||
@@ -11,0 +12,0 @@ "devDependencies": { |
@@ -44,4 +44,10 @@ import { Compiler, DefinePlugin, compilation } from 'webpack'; | ||
const isWebpack3 = !compiler.hooks; | ||
const plugin = (compilation: compilation.Compilation) => { | ||
if (!this.verifyOptions(compiler, compilation)) { | ||
if (isWebpack3) { | ||
return; | ||
} | ||
return Promise.reject(); | ||
@@ -61,4 +67,3 @@ } | ||
if (!compiler.hooks) { | ||
// webpack 3 | ||
if (isWebpack3) { | ||
compiler.plugin('after-emit', plugin); | ||
@@ -68,4 +73,4 @@ return; | ||
// webpack >4 | ||
compiler.hooks.afterEmit.tapPromise('GetSourcemapsAndUploadToFlare', plugin); | ||
// webpack >=4 | ||
compiler.hooks.afterEmit.tapPromise('GetSourcemapsAndUploadToFlare', plugin as () => Promise<any>); | ||
} | ||
@@ -79,3 +84,6 @@ | ||
if (!this.runInDevelopment && compiler.options.mode === 'development') { | ||
if ( | ||
(!this.runInDevelopment && compiler.options.mode === 'development') || | ||
process.env.NODE_ENV === 'development' | ||
) { | ||
flareLog('Running webpack in development mode, not uploading sourcemaps to Flare.'); | ||
@@ -82,0 +90,0 @@ return false; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
16243
8
344
3