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

lib/input/dependency.js

Lines changed: 4 additions & 1 deletion
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)

package.json

Lines changed: 1 addition & 0 deletions
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",

test/fixture/es6-import.input.js

Lines changed: 1 addition & 1 deletion
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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy