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

customize-cra

Package Overview
Dependencies
Maintainers
1
Versions
42
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

customize-cra - npm Package Compare versions

Comparing version 0.9.1 to 1.0.0-alpha.0

2

dist/index.cjs.js

@@ -1,2 +0,2 @@

"use strict";function _interopDefault(e){return e&&"object"==typeof e&&"default"in e?e.default:e}Object.defineProperty(exports,"__esModule",{value:!0});var flow=_interopDefault(require("lodash.flow"));function _defineProperty(e,s,t){return s in e?Object.defineProperty(e,s,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[s]=t,e}function _objectSpread2(e){for(var s=1;s<arguments.length;s++)if(s%2){var t=null!=arguments[s]?arguments[s]:{},r=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(t).filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.forEach(function(s){_defineProperty(e,s,t[s])})}else Object.defineProperties(e,Object.getOwnPropertyDescriptors(arguments[s]));return e}const getBabelLoader=(e,s)=>{let t;t=s?e=>e.loader&&e.loader.includes("babel")&&e.exclude:e=>e.loader&&e.loader.includes("babel")&&e.include;let r=e.module.rules.find(e=>Array.isArray(e.oneOf)).oneOf,o=r.find(t);return o||(o=(r=r.reduce((e,s)=>e.concat(s.use||[]),[])).find(t)),o},tap=e=>s=>{const{message:t,dest:r}=e||{},o=[];if(t&&o.push(t),o.push(JSON.stringify(s,null,2)),r){require("fs").appendFile(r,`${o.join("\n")}\n`)}return o.forEach(e=>console.log(e)),s},addBundleVisualizer=(e={},s=!1)=>t=>{const r=require("webpack-bundle-analyzer").BundleAnalyzerPlugin;return s&&!process.argv.includes("--analyze")||t.plugins.push(new r(Object.assign({analyzerMode:"static",reportFilename:"report.html"},e))),t},disableEsLint=()=>e=>{return e.module.rules.filter(e=>e.use&&e.use.some(e=>e.options&&void 0!==e.options.useEslintrc)).forEach(s=>{e.module.rules=e.module.rules.filter(e=>e!==s)}),e},addWebpackAlias=e=>s=>(s.resolve||(s.resolve={}),s.resolve.alias||(s.resolve.alias={}),Object.assign(s.resolve.alias,e),s),addWebpackResolve=e=>s=>(s.resolve||(s.resolve={}),Object.assign(s.resolve,e),s),addWebpackPlugin=e=>s=>(s.plugins.push(e),s),adjustWorkbox=e=>s=>(s.plugins.forEach(s=>{"GenerateSW"===s.constructor.name&&e(s.config)}),s),adjustStyleLoaders=e=>s=>{const t="prod"===("production"===process.env.NODE_ENV?"prod":"dev")?"css-extract-plugin":"style-loader";return s.module.rules.find(e=>Array.isArray(e.oneOf)).oneOf.filter(({use:e})=>e&&e[0]&&(e[0].loader||e[0]).includes(t)).forEach(s=>e(s)),s},useEslintRc=e=>s=>{const t=s.module.rules.filter(e=>e.use&&e.use.some(e=>e.options&&void 0!==e.options.useEslintrc))[0];t.use[0].options.useEslintrc=!0,t.use[0].options.ignore=!0,t.use[0].options.configFile=e,delete t.use[0].options.baseConfig;const r=s.module.rules.map(e=>e.use&&e.use.some(e=>e.options&&void 0!==e.options.useEslintrc)?t:e);return s.module.rules=r,s},enableEslintTypescript=()=>e=>{const s=e.module.rules.filter(e=>e.use&&e.use.some(e=>e.options&&void 0!==e.options.useEslintrc))[0];s.test=/\.([j,t]sx?|mjs)$/;const t=e.module.rules.map(e=>e.use&&e.use.some(e=>e.options&&void 0!==e.options.useEslintrc)?s:e);return e.module.rules=t,e},addLessLoader=(e={})=>s=>{const t="development"===process.env.NODE_ENV?"dev":"prod",r="./"===require("react-scripts/config/paths").servedPath,o="prod"===t&&"false"!==process.env.GENERATE_SOURCEMAP,a=/\.module\.less$/,l=e.localIdentName||"[path][name]__[local]--[hash:base64:5]",n=s=>["dev"===t?require.resolve("style-loader"):{loader:require("mini-css-extract-plugin").loader,options:Object.assign({},r?{publicPath:"../../"}:void 0)},{loader:require.resolve("css-loader"),options:s},{loader:require.resolve("postcss-loader"),options:{ident:"postcss",plugins:()=>[require("postcss-flexbugs-fixes"),require("postcss-preset-env")({autoprefixer:{flexbox:"no-2009"},stage:3})],sourceMap:o}},{loader:require.resolve("less-loader"),options:Object.assign(e,{source:o})}],i=s.module.rules.find(e=>Array.isArray(e.oneOf)).oneOf;return i.splice(i.length-1,0,{test:/\.less$/,exclude:a,use:n({importLoaders:2}),sideEffects:"prod"===t},{test:a,use:n({importLoaders:2,modules:!0,localIdentName:l})}),s},watchAll=()=>e=>(process.argv.includes("--watch-all")&&delete e.watchOptions,e),disableChunk=()=>e=>(e.optimization.splitChunks={cacheGroups:{default:!1}},e.optimization.runtimeChunk=!1,e),addWebpackExternals=e=>s=>{let t=s.externals;return t?Array.isArray(e)?t=e.concat(t):Array.isArray(t)||e.constructor===Function||e.constructor===RegExp?t=[e].concat(t):e instanceof Object&&t instanceof Object&&(t=_objectSpread2({},t,{},e)):t=e,s.externals=t,s},addPostcssPlugins=e=>s=>{return s.module.rules.find(e=>Array.isArray(e.oneOf)).oneOf.forEach(s=>s.use&&s.use.forEach(s=>{if(s.options&&"postcss"===s.options.ident&&(s.options.plugins||(s.options.plugins=()=>[...e]),s.options.plugins)){const t=s.options.plugins;s.options.plugins=()=>[...t(),...e]}})),s},removeModuleScopePlugin=()=>e=>(e.resolve.plugins=e.resolve.plugins.filter(e=>"ModuleScopePlugin"!==e.constructor.name),e),addWebpackModuleRule=e=>s=>{for(let t of s.module.rules)if(t.oneOf){t.oneOf.unshift(e);break}return s},addTslintLoader=e=>s=>(s.module.rules.unshift({test:/\.(ts|tsx)$/,loader:"tslint-loader",options:e,enforce:"pre"}),s),setWebpackTarget=e=>s=>(s.target=e,s),setWebpackPublicPath=e=>s=>(e&&(e.startsWith("http")||e.startsWith("https")||e.startsWith("/")||(e="/"+e),e.endsWith("/")||(e+="/"),s.output.publicPath=e),s),setWebpackOptimizationSplitChunks=e=>s=>(e&&"object"==typeof e&&(s.optimization.splitChunks=e),s),setWebpackStats=e=>s=>(s.stats=e,s),addBabelPlugin=e=>s=>(getBabelLoader(s).options.plugins.push(e),s),addExternalBabelPlugin=e=>s=>{const t=getBabelLoader(s,!0).options;return t.plugins||(t.plugins=[]),t.plugins.push(e),s},addBabelPreset=e=>s=>(getBabelLoader(s).options.presets.push(e),s),addDecoratorsLegacy=()=>e=>addBabelPlugin(["@babel/plugin-proposal-decorators",{legacy:!0}])(e),useBabelRc=()=>e=>(getBabelLoader(e).options.babelrc=!0,e),babelInclude=e=>s=>(getBabelLoader(s).include=e,s),babelExclude=e=>s=>(getBabelLoader(s).exclude=e,s),addBabelPlugins=(...e)=>e.map(e=>addBabelPlugin(e)),addExternalBabelPlugins=(...e)=>e.map(e=>addExternalBabelPlugin(e)),addBabelPresets=(...e)=>e.map(e=>addBabelPreset(e)),fixBabelImports=(e,s)=>addBabelPlugin(["import",Object.assign({},{libraryName:e},s),`fix-${e}-imports`]),removeInternalBabelPlugin=e=>s=>(s.plugins=s.plugins.filter(s=>s.constructor.name!==e),s),override=(...e)=>flow(...e.filter(e=>e)),overrideDevServer=(...e)=>s=>(t,r)=>{const o=s(t,r);return override(...e)(o)};exports.addBabelPlugin=addBabelPlugin,exports.addBabelPlugins=addBabelPlugins,exports.addBabelPreset=addBabelPreset,exports.addBabelPresets=addBabelPresets,exports.addBundleVisualizer=addBundleVisualizer,exports.addDecoratorsLegacy=addDecoratorsLegacy,exports.addExternalBabelPlugin=addExternalBabelPlugin,exports.addExternalBabelPlugins=addExternalBabelPlugins,exports.addLessLoader=addLessLoader,exports.addPostcssPlugins=addPostcssPlugins,exports.addTslintLoader=addTslintLoader,exports.addWebpackAlias=addWebpackAlias,exports.addWebpackExternals=addWebpackExternals,exports.addWebpackModuleRule=addWebpackModuleRule,exports.addWebpackPlugin=addWebpackPlugin,exports.addWebpackResolve=addWebpackResolve,exports.adjustStyleLoaders=adjustStyleLoaders,exports.adjustWorkbox=adjustWorkbox,exports.babelExclude=babelExclude,exports.babelInclude=babelInclude,exports.disableChunk=disableChunk,exports.disableEsLint=disableEsLint,exports.enableEslintTypescript=enableEslintTypescript,exports.fixBabelImports=fixBabelImports,exports.getBabelLoader=getBabelLoader,exports.override=override,exports.overrideDevServer=overrideDevServer,exports.removeInternalBabelPlugin=removeInternalBabelPlugin,exports.removeModuleScopePlugin=removeModuleScopePlugin,exports.setWebpackOptimizationSplitChunks=setWebpackOptimizationSplitChunks,exports.setWebpackPublicPath=setWebpackPublicPath,exports.setWebpackStats=setWebpackStats,exports.setWebpackTarget=setWebpackTarget,exports.tap=tap,exports.useBabelRc=useBabelRc,exports.useEslintRc=useEslintRc,exports.watchAll=watchAll;
"use strict";function _interopDefault(e){return e&&"object"==typeof e&&"default"in e?e.default:e}Object.defineProperty(exports,"__esModule",{value:!0});var flow=_interopDefault(require("lodash.flow"));function _defineProperty(e,s,t){return s in e?Object.defineProperty(e,s,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[s]=t,e}function _objectSpread2(e){for(var s=1;s<arguments.length;s++)if(s%2){var t=null!=arguments[s]?arguments[s]:{},r=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(t).filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.forEach(function(s){_defineProperty(e,s,t[s])})}else Object.defineProperties(e,Object.getOwnPropertyDescriptors(arguments[s]));return e}const getBabelLoader=(e,s)=>{let t;t=s?e=>e.loader&&e.loader.includes("babel")&&e.exclude:e=>e.loader&&e.loader.includes("babel")&&e.include;let r=e.module.rules.find(e=>Array.isArray(e.oneOf)).oneOf,o=r.find(t);return o||(o=(r=r.reduce((e,s)=>e.concat(s.use||[]),[])).find(t)),o},tap=e=>s=>{const{message:t,dest:r}=e||{},o=[];if(t&&o.push(t),o.push(JSON.stringify(s,null,2)),r){require("fs").appendFile(r,`${o.join("\n")}\n`)}return o.forEach(e=>console.log(e)),s},addBundleVisualizer=(e={},s=!1)=>t=>{const r=require("webpack-bundle-analyzer").BundleAnalyzerPlugin;return s&&!process.argv.includes("--analyze")||t.plugins.push(new r(Object.assign({analyzerMode:"static",reportFilename:"report.html"},e))),t},disableEsLint=()=>e=>{return e.module.rules.filter(e=>e.use&&e.use.some(e=>e.options&&void 0!==e.options.useEslintrc)).forEach(s=>{e.module.rules=e.module.rules.filter(e=>e!==s)}),e},addWebpackAlias=e=>s=>(s.resolve||(s.resolve={}),s.resolve.alias||(s.resolve.alias={}),Object.assign(s.resolve.alias,e),s),addWebpackResolve=e=>s=>(s.resolve||(s.resolve={}),Object.assign(s.resolve,e),s),addWebpackPlugin=e=>s=>(s.plugins.push(e),s),adjustWorkbox=e=>s=>(s.plugins.forEach(s=>{"GenerateSW"===s.constructor.name&&e(s.config)}),s),adjustStyleLoaders=e=>s=>{const t="prod"===("production"===process.env.NODE_ENV?"prod":"dev")?"css-extract-plugin":"style-loader";return s.module.rules.find(e=>Array.isArray(e.oneOf)).oneOf.filter(({use:e})=>e&&e[0]&&(e[0].loader||e[0]).includes(t)).forEach(s=>e(s)),s},useEslintRc=e=>s=>{const t=s.module.rules.filter(e=>e.use&&e.use.some(e=>e.options&&void 0!==e.options.useEslintrc))[0];t.use[0].options.useEslintrc=!0,t.use[0].options.ignore=!0,t.use[0].options.configFile=e,delete t.use[0].options.baseConfig;const r=s.module.rules.map(e=>e.use&&e.use.some(e=>e.options&&void 0!==e.options.useEslintrc)?t:e);return s.module.rules=r,s},enableEslintTypescript=()=>e=>{const s=e.module.rules.filter(e=>e.use&&e.use.some(e=>e.options&&void 0!==e.options.useEslintrc))[0];s.test=/\.([j,t]sx?|mjs)$/;const t=e.module.rules.map(e=>e.use&&e.use.some(e=>e.options&&void 0!==e.options.useEslintrc)?s:e);return e.module.rules=t,e},addLessLoader=(e={})=>s=>{const t=require("mini-css-extract-plugin"),r=require("postcss-normalize"),o=e.cssLoaderOptions||{},a=e.cssModules||{localIdentName:"[local]--[hash:base64:5]"},l=/\.module\.less$/,n=process.env.NODE_ENV,i="development"===n,u="production"===n,d="false"!==process.env.GENERATE_SOURCEMAP,p="./"===s.output.publicPath,c=(s,o)=>{const a=[i&&require.resolve("style-loader"),u&&{loader:t.loader,options:p?{publicPath:"../../"}:{}},{loader:require.resolve("css-loader"),options:s},{loader:require.resolve("postcss-loader"),options:{ident:"postcss",plugins:()=>[require("postcss-flexbugs-fixes"),require("postcss-preset-env")({autoprefixer:{flexbox:"no-2009"},stage:3}),r()],sourceMap:u&&d}}].filter(Boolean);return o&&a.push({loader:require.resolve("resolve-url-loader"),options:{sourceMap:u&&d}},{loader:require.resolve(o),options:Object.assign({sourceMap:!0},e)}),a},b=s.module.rules.find(e=>Array.isArray(e.oneOf)).oneOf;return b.splice(b.length-1,0,{test:/\.less$/,exclude:l,use:c(Object.assign({importLoaders:2,sourceMap:u&&d},o),"less-loader")},{test:l,use:c(Object.assign({importLoaders:2,sourceMap:u&&d},o,{modules:a}),"less-loader")}),s},watchAll=()=>e=>(process.argv.includes("--watch-all")&&delete e.watchOptions,e),disableChunk=()=>e=>(e.optimization.splitChunks={cacheGroups:{default:!1}},e.optimization.runtimeChunk=!1,e),addWebpackExternals=e=>s=>{let t=s.externals;return t?Array.isArray(e)?t=e.concat(t):Array.isArray(t)||e.constructor===Function||e.constructor===RegExp?t=[e].concat(t):e instanceof Object&&t instanceof Object&&(t=_objectSpread2({},t,{},e)):t=e,s.externals=t,s},addPostcssPlugins=e=>s=>{return s.module.rules.find(e=>Array.isArray(e.oneOf)).oneOf.forEach(s=>s.use&&s.use.forEach(s=>{if(s.options&&"postcss"===s.options.ident&&(s.options.plugins||(s.options.plugins=()=>[...e]),s.options.plugins)){const t=s.options.plugins;s.options.plugins=()=>[...t(),...e]}})),s},removeModuleScopePlugin=()=>e=>(e.resolve.plugins=e.resolve.plugins.filter(e=>"ModuleScopePlugin"!==e.constructor.name),e),addWebpackModuleRule=e=>s=>{for(let t of s.module.rules)if(t.oneOf){t.oneOf.unshift(e);break}return s},addTslintLoader=e=>s=>(s.module.rules.unshift({test:/\.(ts|tsx)$/,loader:"tslint-loader",options:e,enforce:"pre"}),s),setWebpackTarget=e=>s=>(s.target=e,s),setWebpackPublicPath=e=>s=>(e&&(e.startsWith("http")||e.startsWith("https")||e.startsWith("/")||(e="/"+e),e.endsWith("/")||(e+="/"),s.output.publicPath=e),s),setWebpackOptimizationSplitChunks=e=>s=>(e&&"object"==typeof e&&(s.optimization.splitChunks=e),s),setWebpackStats=e=>s=>(s.stats=e,s),addBabelPlugin=e=>s=>(getBabelLoader(s).options.plugins.push(e),s),addExternalBabelPlugin=e=>s=>{const t=getBabelLoader(s,!0).options;return t.plugins||(t.plugins=[]),t.plugins.push(e),s},addBabelPreset=e=>s=>(getBabelLoader(s).options.presets.push(e),s),addDecoratorsLegacy=()=>e=>addBabelPlugin(["@babel/plugin-proposal-decorators",{legacy:!0}])(e),useBabelRc=()=>e=>(getBabelLoader(e).options.babelrc=!0,e),babelInclude=e=>s=>(getBabelLoader(s).include=e,s),babelExclude=e=>s=>(getBabelLoader(s).exclude=e,s),addBabelPlugins=(...e)=>e.map(e=>addBabelPlugin(e)),addExternalBabelPlugins=(...e)=>e.map(e=>addExternalBabelPlugin(e)),addBabelPresets=(...e)=>e.map(e=>addBabelPreset(e)),fixBabelImports=(e,s)=>addBabelPlugin(["import",Object.assign({},{libraryName:e},s),`fix-${e}-imports`]),removeInternalBabelPlugin=e=>s=>(s.plugins=s.plugins.filter(s=>s.constructor.name!==e),s),override=(...e)=>flow(...e.filter(e=>e)),overrideDevServer=(...e)=>s=>(t,r)=>{const o=s(t,r);return override(...e)(o)};exports.addBabelPlugin=addBabelPlugin,exports.addBabelPlugins=addBabelPlugins,exports.addBabelPreset=addBabelPreset,exports.addBabelPresets=addBabelPresets,exports.addBundleVisualizer=addBundleVisualizer,exports.addDecoratorsLegacy=addDecoratorsLegacy,exports.addExternalBabelPlugin=addExternalBabelPlugin,exports.addExternalBabelPlugins=addExternalBabelPlugins,exports.addLessLoader=addLessLoader,exports.addPostcssPlugins=addPostcssPlugins,exports.addTslintLoader=addTslintLoader,exports.addWebpackAlias=addWebpackAlias,exports.addWebpackExternals=addWebpackExternals,exports.addWebpackModuleRule=addWebpackModuleRule,exports.addWebpackPlugin=addWebpackPlugin,exports.addWebpackResolve=addWebpackResolve,exports.adjustStyleLoaders=adjustStyleLoaders,exports.adjustWorkbox=adjustWorkbox,exports.babelExclude=babelExclude,exports.babelInclude=babelInclude,exports.disableChunk=disableChunk,exports.disableEsLint=disableEsLint,exports.enableEslintTypescript=enableEslintTypescript,exports.fixBabelImports=fixBabelImports,exports.getBabelLoader=getBabelLoader,exports.override=override,exports.overrideDevServer=overrideDevServer,exports.removeInternalBabelPlugin=removeInternalBabelPlugin,exports.removeModuleScopePlugin=removeModuleScopePlugin,exports.setWebpackOptimizationSplitChunks=setWebpackOptimizationSplitChunks,exports.setWebpackPublicPath=setWebpackPublicPath,exports.setWebpackStats=setWebpackStats,exports.setWebpackTarget=setWebpackTarget,exports.tap=tap,exports.useBabelRc=useBabelRc,exports.useEslintRc=useEslintRc,exports.watchAll=watchAll;
//# sourceMappingURL=index.cjs.js.map

@@ -1,2 +0,2 @@

import e from"lodash.flow";function s(e,s,o){return s in e?Object.defineProperty(e,s,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[s]=o,e}const o=(e,s)=>{let o;o=s?e=>e.loader&&e.loader.includes("babel")&&e.exclude:e=>e.loader&&e.loader.includes("babel")&&e.include;let r=e.module.rules.find(e=>Array.isArray(e.oneOf)).oneOf,t=r.find(o);return t||(t=(r=r.reduce((e,s)=>e.concat(s.use||[]),[])).find(o)),t},r=e=>s=>{const{message:o,dest:r}=e||{},t=[];if(o&&t.push(o),t.push(JSON.stringify(s,null,2)),r){require("fs").appendFile(r,`${t.join("\n")}\n`)}return t.forEach(e=>console.log(e)),s},t=(e={},s=!1)=>o=>{const r=require("webpack-bundle-analyzer").BundleAnalyzerPlugin;return s&&!process.argv.includes("--analyze")||o.plugins.push(new r(Object.assign({analyzerMode:"static",reportFilename:"report.html"},e))),o},n=()=>e=>{return e.module.rules.filter(e=>e.use&&e.use.some(e=>e.options&&void 0!==e.options.useEslintrc)).forEach(s=>{e.module.rules=e.module.rules.filter(e=>e!==s)}),e},i=e=>s=>(s.resolve||(s.resolve={}),s.resolve.alias||(s.resolve.alias={}),Object.assign(s.resolve.alias,e),s),l=e=>s=>(s.resolve||(s.resolve={}),Object.assign(s.resolve,e),s),u=e=>s=>(s.plugins.push(e),s),a=e=>s=>(s.plugins.forEach(s=>{"GenerateSW"===s.constructor.name&&e(s.config)}),s),p=e=>s=>{const o="prod"===("production"===process.env.NODE_ENV?"prod":"dev")?"css-extract-plugin":"style-loader";return s.module.rules.find(e=>Array.isArray(e.oneOf)).oneOf.filter(({use:e})=>e&&e[0]&&(e[0].loader||e[0]).includes(o)).forEach(s=>e(s)),s},c=e=>s=>{const o=s.module.rules.filter(e=>e.use&&e.use.some(e=>e.options&&void 0!==e.options.useEslintrc))[0];o.use[0].options.useEslintrc=!0,o.use[0].options.ignore=!0,o.use[0].options.configFile=e,delete o.use[0].options.baseConfig;const r=s.module.rules.map(e=>e.use&&e.use.some(e=>e.options&&void 0!==e.options.useEslintrc)?o:e);return s.module.rules=r,s},d=()=>e=>{const s=e.module.rules.filter(e=>e.use&&e.use.some(e=>e.options&&void 0!==e.options.useEslintrc))[0];s.test=/\.([j,t]sx?|mjs)$/;const o=e.module.rules.map(e=>e.use&&e.use.some(e=>e.options&&void 0!==e.options.useEslintrc)?s:e);return e.module.rules=o,e},f=(e={})=>s=>{const o="development"===process.env.NODE_ENV?"dev":"prod",r="./"===require("react-scripts/config/paths").servedPath,t="prod"===o&&"false"!==process.env.GENERATE_SOURCEMAP,n=/\.module\.less$/,i=e.localIdentName||"[path][name]__[local]--[hash:base64:5]",l=s=>["dev"===o?require.resolve("style-loader"):{loader:require("mini-css-extract-plugin").loader,options:Object.assign({},r?{publicPath:"../../"}:void 0)},{loader:require.resolve("css-loader"),options:s},{loader:require.resolve("postcss-loader"),options:{ident:"postcss",plugins:()=>[require("postcss-flexbugs-fixes"),require("postcss-preset-env")({autoprefixer:{flexbox:"no-2009"},stage:3})],sourceMap:t}},{loader:require.resolve("less-loader"),options:Object.assign(e,{source:t})}],u=s.module.rules.find(e=>Array.isArray(e.oneOf)).oneOf;return u.splice(u.length-1,0,{test:/\.less$/,exclude:n,use:l({importLoaders:2}),sideEffects:"prod"===o},{test:n,use:l({importLoaders:2,modules:!0,localIdentName:i})}),s},m=()=>e=>(process.argv.includes("--watch-all")&&delete e.watchOptions,e),g=()=>e=>(e.optimization.splitChunks={cacheGroups:{default:!1}},e.optimization.runtimeChunk=!1,e),b=e=>o=>{let r=o.externals;return r?Array.isArray(e)?r=e.concat(r):Array.isArray(r)||e.constructor===Function||e.constructor===RegExp?r=[e].concat(r):e instanceof Object&&r instanceof Object&&(r=function(e){for(var o=1;o<arguments.length;o++)if(o%2){var r=null!=arguments[o]?arguments[o]:{},t=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(t=t.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),t.forEach(function(o){s(e,o,r[o])})}else Object.defineProperties(e,Object.getOwnPropertyDescriptors(arguments[o]));return e}({},r,{},e)):r=e,o.externals=r,o},h=e=>s=>{return s.module.rules.find(e=>Array.isArray(e.oneOf)).oneOf.forEach(s=>s.use&&s.use.forEach(s=>{if(s.options&&"postcss"===s.options.ident&&(s.options.plugins||(s.options.plugins=()=>[...e]),s.options.plugins)){const o=s.options.plugins;s.options.plugins=()=>[...o(),...e]}})),s},v=()=>e=>(e.resolve.plugins=e.resolve.plugins.filter(e=>"ModuleScopePlugin"!==e.constructor.name),e),O=e=>s=>{for(let o of s.module.rules)if(o.oneOf){o.oneOf.unshift(e);break}return s},y=e=>s=>(s.module.rules.unshift({test:/\.(ts|tsx)$/,loader:"tslint-loader",options:e,enforce:"pre"}),s),E=e=>s=>(s.target=e,s),j=e=>s=>(e&&(e.startsWith("http")||e.startsWith("https")||e.startsWith("/")||(e="/"+e),e.endsWith("/")||(e+="/"),s.output.publicPath=e),s),x=e=>s=>(e&&"object"==typeof e&&(s.optimization.splitChunks=e),s),A=e=>s=>(s.stats=e,s),P=e=>s=>(o(s).options.plugins.push(e),s),q=e=>s=>{const r=o(s,!0).options;return r.plugins||(r.plugins=[]),r.plugins.push(e),s},w=e=>s=>(o(s).options.presets.push(e),s),N=()=>e=>P(["@babel/plugin-proposal-decorators",{legacy:!0}])(e),z=()=>e=>(o(e).options.babelrc=!0,e),k=e=>s=>(o(s).include=e,s),S=e=>s=>(o(s).exclude=e,s),$=(...e)=>e.map(e=>P(e)),C=(...e)=>e.map(e=>q(e)),W=(...e)=>e.map(e=>w(e)),_=(e,s)=>P(["import",Object.assign({},{libraryName:e},s),`fix-${e}-imports`]),D=e=>s=>(s.plugins=s.plugins.filter(s=>s.constructor.name!==e),s),F=(...s)=>e(...s.filter(e=>e)),M=(...e)=>s=>(o,r)=>{const t=s(o,r);return F(...e)(t)};export{P as addBabelPlugin,$ as addBabelPlugins,w as addBabelPreset,W as addBabelPresets,t as addBundleVisualizer,N as addDecoratorsLegacy,q as addExternalBabelPlugin,C as addExternalBabelPlugins,f as addLessLoader,h as addPostcssPlugins,y as addTslintLoader,i as addWebpackAlias,b as addWebpackExternals,O as addWebpackModuleRule,u as addWebpackPlugin,l as addWebpackResolve,p as adjustStyleLoaders,a as adjustWorkbox,S as babelExclude,k as babelInclude,g as disableChunk,n as disableEsLint,d as enableEslintTypescript,_ as fixBabelImports,o as getBabelLoader,F as override,M as overrideDevServer,D as removeInternalBabelPlugin,v as removeModuleScopePlugin,x as setWebpackOptimizationSplitChunks,j as setWebpackPublicPath,A as setWebpackStats,E as setWebpackTarget,r as tap,z as useBabelRc,c as useEslintRc,m as watchAll};
import e from"lodash.flow";function s(e,s,o){return s in e?Object.defineProperty(e,s,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[s]=o,e}const o=(e,s)=>{let o;o=s?e=>e.loader&&e.loader.includes("babel")&&e.exclude:e=>e.loader&&e.loader.includes("babel")&&e.include;let r=e.module.rules.find(e=>Array.isArray(e.oneOf)).oneOf,t=r.find(o);return t||(t=(r=r.reduce((e,s)=>e.concat(s.use||[]),[])).find(o)),t},r=e=>s=>{const{message:o,dest:r}=e||{},t=[];if(o&&t.push(o),t.push(JSON.stringify(s,null,2)),r){require("fs").appendFile(r,`${t.join("\n")}\n`)}return t.forEach(e=>console.log(e)),s},t=(e={},s=!1)=>o=>{const r=require("webpack-bundle-analyzer").BundleAnalyzerPlugin;return s&&!process.argv.includes("--analyze")||o.plugins.push(new r(Object.assign({analyzerMode:"static",reportFilename:"report.html"},e))),o},n=()=>e=>{return e.module.rules.filter(e=>e.use&&e.use.some(e=>e.options&&void 0!==e.options.useEslintrc)).forEach(s=>{e.module.rules=e.module.rules.filter(e=>e!==s)}),e},l=e=>s=>(s.resolve||(s.resolve={}),s.resolve.alias||(s.resolve.alias={}),Object.assign(s.resolve.alias,e),s),i=e=>s=>(s.resolve||(s.resolve={}),Object.assign(s.resolve,e),s),u=e=>s=>(s.plugins.push(e),s),a=e=>s=>(s.plugins.forEach(s=>{"GenerateSW"===s.constructor.name&&e(s.config)}),s),p=e=>s=>{const o="prod"===("production"===process.env.NODE_ENV?"prod":"dev")?"css-extract-plugin":"style-loader";return s.module.rules.find(e=>Array.isArray(e.oneOf)).oneOf.filter(({use:e})=>e&&e[0]&&(e[0].loader||e[0]).includes(o)).forEach(s=>e(s)),s},c=e=>s=>{const o=s.module.rules.filter(e=>e.use&&e.use.some(e=>e.options&&void 0!==e.options.useEslintrc))[0];o.use[0].options.useEslintrc=!0,o.use[0].options.ignore=!0,o.use[0].options.configFile=e,delete o.use[0].options.baseConfig;const r=s.module.rules.map(e=>e.use&&e.use.some(e=>e.options&&void 0!==e.options.useEslintrc)?o:e);return s.module.rules=r,s},d=()=>e=>{const s=e.module.rules.filter(e=>e.use&&e.use.some(e=>e.options&&void 0!==e.options.useEslintrc))[0];s.test=/\.([j,t]sx?|mjs)$/;const o=e.module.rules.map(e=>e.use&&e.use.some(e=>e.options&&void 0!==e.options.useEslintrc)?s:e);return e.module.rules=o,e},f=(e={})=>s=>{const o=require("mini-css-extract-plugin"),r=require("postcss-normalize"),t=e.cssLoaderOptions||{},n=e.cssModules||{localIdentName:"[local]--[hash:base64:5]"},l=/\.module\.less$/,i=process.env.NODE_ENV,u="development"===i,a="production"===i,p="false"!==process.env.GENERATE_SOURCEMAP,c="./"===s.output.publicPath,d=(s,t)=>{const n=[u&&require.resolve("style-loader"),a&&{loader:o.loader,options:c?{publicPath:"../../"}:{}},{loader:require.resolve("css-loader"),options:s},{loader:require.resolve("postcss-loader"),options:{ident:"postcss",plugins:()=>[require("postcss-flexbugs-fixes"),require("postcss-preset-env")({autoprefixer:{flexbox:"no-2009"},stage:3}),r()],sourceMap:a&&p}}].filter(Boolean);return t&&n.push({loader:require.resolve("resolve-url-loader"),options:{sourceMap:a&&p}},{loader:require.resolve(t),options:Object.assign({sourceMap:!0},e)}),n},f=s.module.rules.find(e=>Array.isArray(e.oneOf)).oneOf;return f.splice(f.length-1,0,{test:/\.less$/,exclude:l,use:d(Object.assign({importLoaders:2,sourceMap:a&&p},t),"less-loader")},{test:l,use:d(Object.assign({importLoaders:2,sourceMap:a&&p},t,{modules:n}),"less-loader")}),s},m=()=>e=>(process.argv.includes("--watch-all")&&delete e.watchOptions,e),g=()=>e=>(e.optimization.splitChunks={cacheGroups:{default:!1}},e.optimization.runtimeChunk=!1,e),b=e=>o=>{let r=o.externals;return r?Array.isArray(e)?r=e.concat(r):Array.isArray(r)||e.constructor===Function||e.constructor===RegExp?r=[e].concat(r):e instanceof Object&&r instanceof Object&&(r=function(e){for(var o=1;o<arguments.length;o++)if(o%2){var r=null!=arguments[o]?arguments[o]:{},t=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(t=t.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),t.forEach(function(o){s(e,o,r[o])})}else Object.defineProperties(e,Object.getOwnPropertyDescriptors(arguments[o]));return e}({},r,{},e)):r=e,o.externals=r,o},h=e=>s=>{return s.module.rules.find(e=>Array.isArray(e.oneOf)).oneOf.forEach(s=>s.use&&s.use.forEach(s=>{if(s.options&&"postcss"===s.options.ident&&(s.options.plugins||(s.options.plugins=()=>[...e]),s.options.plugins)){const o=s.options.plugins;s.options.plugins=()=>[...o(),...e]}})),s},O=()=>e=>(e.resolve.plugins=e.resolve.plugins.filter(e=>"ModuleScopePlugin"!==e.constructor.name),e),v=e=>s=>{for(let o of s.module.rules)if(o.oneOf){o.oneOf.unshift(e);break}return s},y=e=>s=>(s.module.rules.unshift({test:/\.(ts|tsx)$/,loader:"tslint-loader",options:e,enforce:"pre"}),s),E=e=>s=>(s.target=e,s),j=e=>s=>(e&&(e.startsWith("http")||e.startsWith("https")||e.startsWith("/")||(e="/"+e),e.endsWith("/")||(e+="/"),s.output.publicPath=e),s),x=e=>s=>(e&&"object"==typeof e&&(s.optimization.splitChunks=e),s),A=e=>s=>(s.stats=e,s),P=e=>s=>(o(s).options.plugins.push(e),s),q=e=>s=>{const r=o(s,!0).options;return r.plugins||(r.plugins=[]),r.plugins.push(e),s},w=e=>s=>(o(s).options.presets.push(e),s),M=()=>e=>P(["@babel/plugin-proposal-decorators",{legacy:!0}])(e),z=()=>e=>(o(e).options.babelrc=!0,e),N=e=>s=>(o(s).include=e,s),k=e=>s=>(o(s).exclude=e,s),S=(...e)=>e.map(e=>P(e)),$=(...e)=>e.map(e=>q(e)),C=(...e)=>e.map(e=>w(e)),W=(e,s)=>P(["import",Object.assign({},{libraryName:e},s),`fix-${e}-imports`]),D=e=>s=>(s.plugins=s.plugins.filter(s=>s.constructor.name!==e),s),F=(...s)=>e(...s.filter(e=>e)),G=(...e)=>s=>(o,r)=>{const t=s(o,r);return F(...e)(t)};export{P as addBabelPlugin,S as addBabelPlugins,w as addBabelPreset,C as addBabelPresets,t as addBundleVisualizer,M as addDecoratorsLegacy,q as addExternalBabelPlugin,$ as addExternalBabelPlugins,f as addLessLoader,h as addPostcssPlugins,y as addTslintLoader,l as addWebpackAlias,b as addWebpackExternals,v as addWebpackModuleRule,u as addWebpackPlugin,i as addWebpackResolve,p as adjustStyleLoaders,a as adjustWorkbox,k as babelExclude,N as babelInclude,g as disableChunk,n as disableEsLint,d as enableEslintTypescript,W as fixBabelImports,o as getBabelLoader,F as override,G as overrideDevServer,D as removeInternalBabelPlugin,O as removeModuleScopePlugin,x as setWebpackOptimizationSplitChunks,j as setWebpackPublicPath,A as setWebpackStats,E as setWebpackTarget,r as tap,z as useBabelRc,c as useEslintRc,m as watchAll};
//# sourceMappingURL=index.esm.js.map
{
"name": "customize-cra",
"version": "0.9.1",
"version": "1.0.0-alpha.0",
"description": "",

@@ -5,0 +5,0 @@ "repository": "arackaf/customize-cra",

# `customize-cra`
<<<<<<< HEAD
[![All Contributors](https://img.shields.io/badge/all_contributors-16-orange.svg?style=flat-square)](#contributors-)
=======
[![All Contributors](https://img.shields.io/badge/all_contributors-12-orange.svg?style=flat-square)](#contributors-)
>>>>>>> docs: add @1123612483 as a contributor
[![All Contributors](https://img.shields.io/badge/all_contributors-17-orange.svg?style=flat-square)](#contributors-)

@@ -154,2 +150,3 @@ This project provides a set of utilities to customize [`create-react-app`](https://github.com/facebook/create-react-app) versions 2 and 3 configurations leveraging [`react-app-rewired`](https://github.com/timarney/react-app-rewired/) core functionalities.

<td align="center"><a href="https://github.com/1123612483"><img src="https://avatars1.githubusercontent.com/u/20741541?v=4" width="100px;" alt="Juetta"/><br /><sub><b>Juetta</b></sub></a><br /><a href="https://github.com/arackaf/customize-cra/commits?author=1123612483" title="Code">πŸ’»</a></td>
<td align="center"><a href="https://www.onlyling.com"><img src="https://avatars3.githubusercontent.com/u/9999765?v=4" width="100px;" alt="LING_ZI_QING"/><br /><sub><b>LING_ZI_QING</b></sub></a><br /><a href="https://github.com/arackaf/customize-cra/commits?author=onlyling" title="Code">πŸ’»</a> <a href="https://github.com/arackaf/customize-cra/commits?author=onlyling" title="Documentation">πŸ“–</a></td>
</tr>

@@ -156,0 +153,0 @@ </table>

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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