Skip to content

Commit

Permalink
fix: fix module resolving
Browse files Browse the repository at this point in the history
This issue fixes #59

It is possible to create a configuration which will result into a wrong state but it should not happen in 99.99% cases.
  • Loading branch information
gregberge committed May 12, 2018
1 parent 624e8f8 commit 10318b0
Show file tree
Hide file tree
Showing 13 changed files with 234 additions and 48 deletions.
1 change: 1 addition & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"jest": true
},
"rules": {
"no-plusplus": "off",
"no-param-reassign": "off",
"react/jsx-filename-extension": ["error", { "extensions": [".js"] }],
"react/jsx-wrap-multilines": "off",
Expand Down
16 changes: 11 additions & 5 deletions example/.babelrc
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
{
"presets": ["react", ["env", {
"targets": {
"node": "current"
}
}]],
"presets": [
"react",
[
"env",
{
"targets": {
"node": "current"
}
}
]
],
"plugins": [
"dynamic-import-node",
"loadable-components/babel",
Expand Down
2 changes: 1 addition & 1 deletion example/.gitignore
Original file line number Diff line number Diff line change
@@ -1 +1 @@
public/*.js
public
1 change: 1 addition & 0 deletions example/A/Component.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export default () => 'A'
6 changes: 6 additions & 0 deletions example/A/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import React, { Component } from 'react'
import loadable from 'loadable-components'

const Loaded = loadable(() => import('./Component'))

export default Loaded
4 changes: 4 additions & 0 deletions example/App.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import React from 'react'
import loadable from 'loadable-components'
import { hot } from 'react-hot-loader'
import A from './A'
import B from './B'

const AsyncWhat = loadable(() =>
import(/* webpackChunkName: "What" */ './What.js'),
Expand All @@ -12,6 +14,8 @@ const AsyncBig = loadable(() =>

const App = () => (
<div>
<A />
<B />
Hello <AsyncWhat />!
</div>
)
Expand Down
1 change: 1 addition & 0 deletions example/B/Component.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export default () => 'B'
6 changes: 6 additions & 0 deletions example/B/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import React, { Component } from 'react'
import loadable from 'loadable-components'

const Loaded = loadable(() => import('./Component'))

export default Loaded
12 changes: 6 additions & 6 deletions example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
},
"dependencies": {
"express": "^4.16.3",
"loadable-components": "/Users/neoziro/projects/loadable-components/loadable-components-v1.4.1-alpha.2.tgz",
"loadable-components": "latest",
"react": "^16.3.2",
"react-dom": "^16.3.2",
"react-hot-loader": "^4.1.2"
"react-hot-loader": "^4.1.3"
},
"devDependencies": {
"babel-cli": "^6.26.0",
Expand All @@ -21,11 +21,11 @@
"babel-plugin-syntax-dynamic-import": "^6.18.0",
"babel-plugin-transform-class-properties": "^6.24.1",
"babel-plugin-transform-object-rest-spread": "^6.26.0",
"babel-preset-env": "^1.6.1",
"babel-preset-env": "^1.7.0",
"babel-preset-react": "^6.24.1",
"nodemon": "^1.17.3",
"webpack": "^4.7.0",
"webpack-cli": "^2.1.2",
"nodemon": "^1.17.4",
"webpack": "^4.8.2",
"webpack-cli": "^2.1.3",
"webpack-dev-server": "^3.1.4"
}
}
1 change: 1 addition & 0 deletions example/server.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import path from 'path'
import React from 'react'
import ReactDOMServer from 'react-dom/server'
import express from 'express'
Expand Down
Loading

0 comments on commit 10318b0

Please sign in to comment.