Setting up webpack resolve root
This commit is contained in:
parent
6b55f1ec72
commit
8817b5f027
@ -32,8 +32,12 @@
|
||||
"snapshotSerializers": [
|
||||
"enzyme-to-json/serializer"
|
||||
],
|
||||
"modulePaths": [
|
||||
"src",
|
||||
"node_modules"
|
||||
],
|
||||
"moduleNameMapper": {
|
||||
"\\.svg$": "<rootDir>/src/__mocks__/svgMock.js",
|
||||
"\\.svg$": "__mocks__/svgMock.js",
|
||||
"\\.css$": "identity-obj-proxy"
|
||||
},
|
||||
"collectCoverageFrom": [
|
||||
|
@ -1,6 +1,6 @@
|
||||
import React from 'react';
|
||||
|
||||
import Message from './Message';
|
||||
import Message from 'components/Message';
|
||||
|
||||
const App = () => (
|
||||
<Message heading="React App">
|
||||
|
@ -1,7 +1,7 @@
|
||||
import React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
|
||||
import RavenError from '../RavenError';
|
||||
import RavenError from 'components/RavenError';
|
||||
|
||||
class RavenBoundary extends React.Component {
|
||||
constructor() {
|
||||
|
@ -1,9 +1,9 @@
|
||||
import React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import { translate, Trans } from 'react-i18next';
|
||||
import { Raven } from '../../sentry';
|
||||
import { Raven } from 'sentry';
|
||||
|
||||
import Message from '../Message';
|
||||
import Message from 'components/Message';
|
||||
import AlertIcon from 'feather-icons/dist/icons/alert-octagon.svg';
|
||||
|
||||
class RavenError extends React.Component {
|
||||
|
@ -2,10 +2,10 @@ import React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import { translate, Trans } from 'react-i18next';
|
||||
|
||||
import Message from '../../components/Message';
|
||||
import Message from 'components/Message';
|
||||
import AlertIcon from 'feather-icons/dist/icons/alert-octagon.svg';
|
||||
import Header from '../../components/Header';
|
||||
import Footer from '../../components/Footer';
|
||||
import Header from 'components/Header';
|
||||
import Footer from 'components/Footer';
|
||||
|
||||
const Component = ({ t }) => (
|
||||
<React.Fragment>
|
||||
|
@ -2,12 +2,12 @@ import React from 'react';
|
||||
import ReactDOM from 'react-dom';
|
||||
|
||||
import Component from './Component';
|
||||
import RavenBoundary from '../../components/RavenBoundary';
|
||||
import RavenBoundary from 'components/RavenBoundary';
|
||||
|
||||
import '../../style.css';
|
||||
import '../../i18n';
|
||||
import { setupGA } from '../../analytics';
|
||||
import { Raven, setupRaven } from '../../sentry';
|
||||
import 'site.css';
|
||||
import 'i18n';
|
||||
import { setupGA } from 'analytics';
|
||||
import { Raven, setupRaven } from 'sentry';
|
||||
|
||||
setupRaven();
|
||||
|
||||
|
@ -1,10 +1,10 @@
|
||||
import React from 'react';
|
||||
|
||||
import Message from '../../components/Message';
|
||||
import Message from 'components/Message';
|
||||
import AlertIcon from 'feather-icons/dist/icons/alert-octagon.svg';
|
||||
import Header from '../../components/Header';
|
||||
import Footer from '../../components/Footer';
|
||||
import App from '../../components/App';
|
||||
import Header from 'components/Header';
|
||||
import Footer from 'components/Footer';
|
||||
import App from 'components/App';
|
||||
|
||||
const Component = () => (
|
||||
<React.Fragment>
|
||||
|
@ -2,13 +2,13 @@ import React from 'react';
|
||||
import ReactDOM from 'react-dom';
|
||||
|
||||
import Component from './Component';
|
||||
import RavenBoundary from '../../components/RavenBoundary';
|
||||
import RavenBoundary from 'components/RavenBoundary';
|
||||
|
||||
import '../../style.css';
|
||||
import '../../i18n';
|
||||
import { setupServiceWorker } from '../../service-worker';
|
||||
import { setupGA } from '../../analytics';
|
||||
import { Raven, setupRaven } from '../../sentry';
|
||||
import 'site.css';
|
||||
import 'i18n';
|
||||
import { setupServiceWorker } from 'service-worker';
|
||||
import { setupGA } from 'analytics';
|
||||
import { Raven, setupRaven } from 'sentry';
|
||||
|
||||
setupRaven();
|
||||
|
||||
|
@ -44,6 +44,9 @@ module.exports = {
|
||||
chunkFilename: 'js/[name].[chunkhash:8].js',
|
||||
path: path.resolve(__dirname, 'build')
|
||||
},
|
||||
resolve: {
|
||||
modules: ['src', 'node_modules']
|
||||
},
|
||||
plugins: [
|
||||
new webpack.EnvironmentPlugin({
|
||||
NODE_ENV: 'development',
|
||||
|
@ -34,6 +34,9 @@ module.exports = [
|
||||
chunkFilename: '[name].chunk.js',
|
||||
path: path.resolve(__dirname, 'prerender')
|
||||
},
|
||||
resolve: {
|
||||
modules: ['src', 'node_modules']
|
||||
},
|
||||
plugins: [
|
||||
// Only want the EnvironmentPlugin
|
||||
common.plugins.find(plugin => plugin instanceof webpack.EnvironmentPlugin)
|
||||
|
Loading…
Reference in New Issue
Block a user