Skip to content

Commit 4dc8cb0

Browse files
authored
Support system.import with nice handy babel plugin (#603)
* Support system.import with nice handy babel plugin * Use a smaller import * Use smaller imports here too
1 parent 7d40148 commit 4dc8cb0

10 files changed

+314
-4716
lines changed

Diff for: lib/input/dependency.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,10 @@ function dependencyStream(indexes, options, callback) {
4646
require('babel-preset-react')
4747
],
4848
plugins: [
49-
require('babel-plugin-transform-decorators-legacy').default
49+
require('babel-plugin-transform-decorators-legacy').default,
50+
// Required to support webpack's System.import
51+
// https://github.com/documentationjs/documentation/issues/578
52+
require('babel-plugin-system-import-transformer').default
5053
]
5154
})],
5255
postFilter: moduleFilters.externals(indexes, options)

Diff for: package.json

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
"dependencies": {
1010
"ansi-html": "0.0.5",
1111
"babel-core": "^6.17.0",
12+
"babel-plugin-system-import-transformer": "2.4.0",
1213
"babel-plugin-transform-decorators-legacy": "^1.3.4",
1314
"babel-preset-es2015": "^6.16.0",
1415
"babel-preset-react": "^6.16.0",

Diff for: test/fixture/es6-import.input.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import hasEx6 from './es6-ext';
2-
import multiply from "./es6.input.js";
2+
import multiply from "./simple.input.js";
33
import * as foo from "some-other-module";
44

55
/**

0 commit comments

Comments
 (0)