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.2.11 to 0.2.12

32

index.js

@@ -84,2 +84,10 @@ const flow = require("lodash.flow");

const addWebpackResolve = resolve => config => {
if (!config.resolve) {
config.resolve = {};
}
Object.assign(config.resolve, resolve);
return config;
}
const adjustWorkbox = adjust => config => {

@@ -288,2 +296,21 @@ config.plugins.forEach(p => {

// This will remove the CRA plugin that prevents to import modules from
// outside the `src` directory, useful if you use a different directory
const removeModuleScopePlugin = () => config => {
config.resolve.plugins = config.resolve.plugins.filter(
p => p.constructor.name !== "ModuleScopePlugin"
);
return config;
};
const addTslintLoader = (options) => config => {
config.module.rules.unshift({
test: /\.(ts|tsx)$/,
loader: require.resolve("tslint-loader"),
options,
enforce: "pre",
});
return config;
};
module.exports = {

@@ -296,2 +323,3 @@ override,

addWebpackAlias,
addWebpackResolve,
adjustWorkbox,

@@ -311,3 +339,5 @@ useEslintRc,

addPostcssPlugins,
getBabelLoader
getBabelLoader,
removeModuleScopePlugin,
addTslintLoader,
};

2

package.json
{
"name": "customize-cra",
"version": "0.2.11",
"version": "0.2.12",
"description": "",

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

@@ -94,3 +94,3 @@ # customize-cra

Overwites the `include` option for babel loader, for when you need to transpile a module in your `node_modules` folder.
Overwrites the `include` option for babel loader, for when you need to transpile a module in your `node_modules` folder.

@@ -150,2 +150,6 @@ ```js

### addWebpackResolve(resolve)
Adds the provided resolve info into webpack's resolve section. Pass an object literal with as many entries as you'd like, and the whole object will be merged in.
### addBundleVisualizer(options, behindFlag = false)

@@ -241,3 +245,4 @@

strictMath: true,
noIeCompat: true
noIeCompat: true,
localIdentName: '[local]--[hash:base64:5]' // if you use CSS Modules, and custom `localIdentName`, default is '[local]--[hash:base64:5]'.
})

@@ -251,2 +256,4 @@ );

`.module.less` will use CSS Modules.
### disableChunk

@@ -289,2 +296,10 @@

## removeModuleScopePlugin()
This will remove the CRA plugin that prevents to import modules from
outside the `src` directory, useful if you use a different directory.
A common use case is if you are using CRA in a monorepo setup, where your packages
are under `packages/` rather than `src/`.
## MobX Users

@@ -332,13 +347,22 @@

```js
const { override, addPostcssPlugins } = require("customize-cra");
module.exports = override(
addPostcssPlugins([require("postcss-px2rem")({ remUnit: 37.5 })])
);
```
### addTslintLoader(loaderOptions)
Need to install `ts-loader`.
```js
const {
override,
addPostcssPlugins
addTslintLoader
} = require("customize-cra");
module.exports = override(
addPostcssPlugins([
require('postcss-px2rem')({ remUnit: 37.5 })
]),
addTslintLoader(),
);
```
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