Coder Social home page Coder Social logo

react-app-rewire-svgr's People

Contributors

farzinmirzaie avatar gitim avatar lazyd3v avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

react-app-rewire-svgr's Issues

The "getBabelLoader" helper has been deprecated as of v2.0.

devDependencies

react-app-rewire-svgr: ^1.1.1
react-app-rewired: ^2.1.6

config-overrides.js

const fs = require('fs')
const path = require('path')
const webpack = require('webpack')
const rewireSVGR = require('react-app-rewire-svgr')

const rootPath = '../../..'

const appDirectory = fs.realpathSync(process.cwd())
const resolveApp = relativePath => path.resolve(appDirectory, relativePath)

// our packages that will now be included in the CRA build step
const appIncludes = [
	resolveApp('src')
]

module.exports = function override(config, env) {
	config.resolve = {
		...config.resolve,
		modules: [path.resolve(__dirname, 'node_modules'), 'node_modules'],
	}
	// allow importing from outside of src folder
	config.resolve.plugins = config.resolve.plugins.filter(
		plugin => plugin.constructor.name !== 'ModuleScopePlugin'
	)
	config.module.rules[0].include = appIncludes
	config.module.rules[1] = null
	config.module.rules[2].oneOf[1].include = appIncludes
	config.module.rules = config.module.rules.filter(Boolean)
	config.plugins.push(
		new webpack.DefinePlugin({ __DEV__: env !== 'production' })
	)
	config = rewireSVGR(config, env)
	return config
}

error

$ react-app-rewired start
The "getBabelLoader" helper has been deprecated as of v2.0. You can use customize-cra plugins in replacement - https://github.com/arackaf/customize-cra#available-plugins
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
error Command failed.
Exit code: 1
Command: /usr/local/Cellar/node/12.8.0/bin/node
Arguments: /usr/local/Cellar/yarn/1.17.3/libexec/lib/cli.js start
Directory: /Users/farzin/Documents/Programming/Monorepo/cosmos/packages/apps/web
Output:

info Visit https://yarnpkg.com/en/docs/cli/workspace for documentation about this command.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.