Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
p => p.constructor.name !== 'ModuleScopePlugin'
);
return config;
};
/**
* react-app-rewired configuration file
*
* Theses functions are used to override the configurations provided by
* create-react-app to be able to tweak it without ejecting the
* project. Be careful!
*/
module.exports = {
webpack: override(
babelInclude([path.resolve('src'), path.resolve('packages')]),
useEslintRc(),
removeModuleScopePlugin(),
addWebpackAlias(lernaAlias.webpack())
),
jest: config => {
// create-react-app looks for tests in `src`, we look in `packages`
config.roots = ['/packages'];
config.testMatch = config.testMatch.map(m => m.replace('src', 'packages'));
config.collectCoverageFrom = ['**/packages/**/*.js'];
config.coveragePathIgnorePatterns = ['/dist/'];
// we tell Jest to import the @quid packages from their source directory
// rather than from the dist one, so we don't have to build them each time
config.moduleNameMapper = lernaAlias.jest();
return config;
},
url: link
},
template: 'redirect.html',
filename: key + '/index.html',
inject: false,
xhtml: false
})
)
}
return config
}
module.exports = override(
useBabelRc(),
useEslintRc(),
addWebpackAlias({
react: 'preact/compat',
'react-dom': 'preact/compat'
}),
addSitePlugins()
)
const path = require('path');
const {override, useEslintRc, fixBabelImports, addBabelPresets, addBabelPlugins, addWebpackResolve, addLessLoader, addDecoratorsLegacy} = require('customize-cra');
const ModuleScopePlugin = require('react-dev-utils/ModuleScopePlugin');
module.exports = override(
useEslintRc(),
addLessLoader({
javascriptEnabled: true,
modifyVars: {
'@primary-color': "#4777e8",
'@link-color': '#4777e8',
},
}),
addWebpackResolve({
alias: {'@': path.resolve(__dirname, 'src')}
}),
addBabelPlugins(
"@babel/plugin-syntax-object-rest-spread",
const { addBabelPlugins, override, useEslintRc } = require('customize-cra');
module.exports = override(
...addBabelPlugins(
[
'import',
{
libraryName: 'antd',
libraryDirectory: 'es',
style: 'css',
},
],
['lodash', { id: ['lodash'] }]
),
useEslintRc()
);
const { override, useEslintRc, fixBabelImports } = require('customize-cra');
module.exports = override(
useEslintRc('../.eslintrc'),
fixBabelImports('lodash', {
libraryName: 'react-use',
libraryDirectory: 'lib',
camel2DashComponentName: false
})
);
const { override, useEslintRc, addWebpackModuleRule } = require('customize-cra');
const path = require('path');
module.exports = override(
config => ({
...config,
output: {
...config.output,
globalObject: 'this'
},
}),
useEslintRc(path.resolve(__dirname, '.eslintrc')),
addWebpackModuleRule({
test: /\.worker\.js$/,
use: { loader: 'worker-loader' },
})
);