uniswap-interface-uncensored/craco.config.cjs
Jordan Frankfurt 726640787d
fix: use number formatting lib for tick bounds on LP positions (#5573)
* fix: use number formatting lib for tick bounds on LP positions

* lint

* configure craco to work with conedison

* lint
2023-01-09 15:54:48 -06:00

48 lines
1.7 KiB
JavaScript

/* eslint-disable @typescript-eslint/no-var-requires */
const { VanillaExtractPlugin } = require('@vanilla-extract/webpack-plugin')
const MiniCssExtractPlugin = require('mini-css-extract-plugin')
const { DefinePlugin } = require('webpack')
const commitHash = require('child_process').execSync('git rev-parse HEAD')
module.exports = {
babel: {
plugins: ['@vanilla-extract/babel-plugin'],
},
jest: {
configure(jestConfig) {
return Object.assign({}, jestConfig, {
transformIgnorePatterns: ['@uniswap/conedison/format'],
moduleNameMapper: {
'@uniswap/conedison/format': '@uniswap/conedison/dist/format',
},
})
},
},
webpack: {
plugins: [
new VanillaExtractPlugin(),
new DefinePlugin({
'process.env.REACT_APP_GIT_COMMIT_HASH': JSON.stringify(commitHash.toString()),
}),
],
configure: (webpackConfig) => {
const instanceOfMiniCssExtractPlugin = webpackConfig.plugins.find(
(plugin) => plugin instanceof MiniCssExtractPlugin
)
if (instanceOfMiniCssExtractPlugin !== undefined) instanceOfMiniCssExtractPlugin.options.ignoreOrder = true
// We're currently on Webpack 4.x that doesn't support the `exports` field in package.json.
// See https://github.com/webpack/webpack/issues/9509.
//
// In case you need to add more modules, make sure to remap them to the correct path.
//
// Map @uniswap/conedison to its dist folder.
// This is required because conedison uses * to redirect all imports to its dist.
webpackConfig.resolve.alias['@uniswap/conedison'] = '@uniswap/conedison/dist'
return webpackConfig
},
},
}