Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@arnosaine/extend-react-scripts

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@arnosaine/extend-react-scripts - npm Package Compare versions

Comparing version 0.2.1 to 0.3.0

src/requireResolveCwdSafe.js

2

package.json
{
"name": "@arnosaine/extend-react-scripts",
"version": "0.2.1",
"version": "0.3.0",
"description": "Helper package for @arnosaine/react-scripts.",

@@ -5,0 +5,0 @@ "repository": {

# @arnosaine/extend-react-scripts
Helper package for [@arnosaine/react-scripts](react-scripts).
Helper package for [@arnosaine/react-scripts](https://www.npmjs.com/package/@arnosaine/react-scripts).

@@ -1,17 +0,27 @@

import equals from './equals';
import { strict as assert } from 'assert';
import requireResolveCwdSafe from './requireResolveCwdSafe';
const babelLoader = require.resolve('babel-loader');
export default config => {
const hasConfig = ['.babelrc', 'babel.config'].some(requireResolveCwdSafe);
export default (config) => {
for (const { oneOf = [] } of config.module.rules) {
for (const { loader, options } of oneOf) {
if (loader === babelLoader) {
equals(options.babelrc, false, 'babelrc');
delete options.babelrc;
if (hasConfig) {
const babelLoader = require.resolve('babel-loader');
for (const { oneOf } of config.module.rules) {
if (oneOf) {
for (const { loader, options } of oneOf) {
if (loader === babelLoader) {
assert.equal(options.babelrc, false, 'babelrc');
delete options.babelrc;
equals(options.configFile, false, 'babel.config.js');
delete options.configFile;
assert.equal(options.configFile, false, 'configFile');
delete options.configFile;
equals(!options.cacheIdentifier, false, 'cacheIdentifier');
delete options.cacheIdentifier;
assert.equal(
typeof options.cacheIdentifier,
'string',
'cacheIdentifier'
);
delete options.cacheIdentifier;
}
}
}

@@ -18,0 +28,0 @@ }

import babel from './babel';
import eslint from './eslint';
import requireResolveCwdSafe from './requireResolveCwdSafe';
export default module => {
let configPath;
for (const path of [
`${process.cwd()}/webpack.config`,
'../../../../webpack.config',
]) {
try {
configPath = require.resolve(path);
break;
} catch (error) {
// No custom config found.
}
}
const configPath = requireResolveCwdSafe('webpack.config');
const config = module.exports;
const extended = env => babel(eslint(config(env)));
const extended = env => babel(config(env));
module.exports = configPath

@@ -20,0 +9,0 @@ ? env => {

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc