Open kwhitaker opened 8 years ago
Are you using CommonJS or es6 imports? Can you share a link to the source code, or any other details?
@tmcw I'm using ES6 imports.
Here's a snippet of the source code:
import {connect} from 'react-redux'
import {fetchConfig} from 'state/config'
import Config from 'components/ecosystems/config'
import React, {PropTypes} from 'react'
import TitleBar from 'components/molecules/title-bar'
import NotFound from 'components/organisms/not-found'
import SiteFooter from 'components/atoms/site-footer'
import './global.sass'
/**
* The Layout component is the top-level component of the app.
*/
export class Layout extends React.Component {
static propTypes = {
config: PropTypes.shape({
existing: PropTypes.bool,
error: PropTypes.object,
loading: PropTypes.bool.isRequired,
serverSettings: PropTypes.shape({
hostName: PropTypes.string,
userName: PropTypes.string,
password: PropTypes.string,
version: PropTypes.string,
}),
}),
development: PropTypes.bool,
dispatch: PropTypes.func,
fetchConfig: PropTypes.func,
router: PropTypes.shape({
url: PropTypes.string,
route: PropTypes.shape({
name: PropTypes.string,
options: PropTypes.object,
}),
}),
};
componentDidMount() {
this.props.fetchConfig()
}
/**
* Only include DevTools if in development.
* @returns {React.Component}
*/
renderDevTools() {
if (this.props.development) {
const DevTools = require('utils/dev-tools')
return <DevTools/>
}
return null
}
/**
* Return the main content selected by the current route.
* @returns {React.Component}
*/
renderMainContent() {
const {config} = this.props
if (!config.existing) {
return <Config isFetching={config.loading}/>
}
switch (this.props.router.route.name) {
case 'config':
return <Config/>
default:
return <NotFound path={this.props.router.url}/>
}
}
render() {
const {config, router} = this.props
const existingConfig = config.existing && !config.loading
return (
<div>
<TitleBar currentRoute={router.route.name} showNav={existingConfig}/>
{this.renderMainContent()}
<SiteFooter version={config.serverSettings.version}/>
{this.renderDevTools()}
</div>
)
}
}
export default connect(
state => ({
router: state.router,
config: state.config.toJS(),
}), {fetchConfig}
)(Layout)
I am having the same issue with CommonJS requires.
When I attempt to run my gulp-documentation task, it works fine on the file pointed to as the
src
, but won't recurse into any of my imported files.Here's the task in question:
and the command I use to run my gulp task: