Skip to content

Commit

Permalink
[Deps]: add babel plugins to make dynamic import work
Browse files Browse the repository at this point in the history
add two plugins: babel-plugin-dynamic-import-node and babel-plugin-syntax-dynamic-import
  • Loading branch information
chenesan committed Jan 10, 2019
1 parent 435e0d1 commit f937dec
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .babelrc
Expand Up @@ -2,6 +2,8 @@
"presets": ["airbnb"],
"plugins": [
["transform-replace-object-assign", { "moduleSpecifier": "object.assign" }],
"syntax-dynamic-import",
"dynamic-import-node"
],
ignore: [
"packages/enzyme-test-suite/test/_helpers/untranspiled*",
Expand Down
2 changes: 2 additions & 0 deletions package.json
Expand Up @@ -66,6 +66,8 @@
"babel-core": "^6.26.3",
"babel-eslint": "^7.2.3",
"babel-loader": "^6.4.1",
"babel-plugin-dynamic-import-node": "^2.2.0",
"babel-plugin-syntax-dynamic-import": "^6.18.0",
"babel-plugin-transform-replace-object-assign": "^1.0.0",
"babel-preset-airbnb": "^2.6.0",
"babel-register": "^6.26.0",
Expand Down
1 change: 1 addition & 0 deletions packages/enzyme-test-suite/test/Adapter-spec.jsx
Expand Up @@ -15,6 +15,7 @@ import {
createContext,
createPortal,
forwardRef,
lazy,
Fragment,
StrictMode,
AsyncMode,
Expand Down
@@ -0,0 +1,11 @@
import React from 'react'

class DynamicComponent extends React.Component {
render() {
return (
<div>Dynamic Component</div>
);
}
}

module.exports = DynamicComponent;

0 comments on commit f937dec

Please sign in to comment.