Skip to content

Commit

Permalink
[parser] enable dynamic import by default
Browse files Browse the repository at this point in the history
  • Loading branch information
AbdulAli19 committed Dec 9, 2019
1 parent 0164662 commit baceca9
Show file tree
Hide file tree
Showing 45 changed files with 4 additions and 55 deletions.
17 changes: 0 additions & 17 deletions packages/babel-core/test/api.js
Expand Up @@ -754,23 +754,6 @@ describe("api", function() {
babelrc: false,
};

it("only syntax plugin available", function(done) {
transformFile(
__dirname + "/fixtures/api/parsing-errors/only-syntax/file.js",
options,
function(err) {
expect(err.message).toMatch(
"Support for the experimental syntax 'dynamicImport' isn't currently enabled (1:9)",
);
expect(err.message).toMatch(
"Add @babel/plugin-syntax-dynamic-import (https://git.io/vb4Sv) to the " +
"'plugins' section of your Babel config to enable parsing.",
);
done();
},
);
});

it("both syntax and transform plugin available", function(done) {
transformFile(
__dirname + "/fixtures/api/parsing-errors/syntax-and-transform/file.js",
Expand Down

This file was deleted.

2 changes: 0 additions & 2 deletions packages/babel-parser/src/parser/expression.js
Expand Up @@ -949,8 +949,6 @@ export default class ExpressionParser extends LValParser {
return this.parseImportMetaProperty(node);
}

this.expectPlugin("dynamicImport", node.start);

if (!this.match(tt.parenL)) {
this.unexpected(null, tt.parenL);
}
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

@@ -1,4 +1,4 @@
{
"plugins": ["dynamicImport", "importMeta"],
"plugins": ["importMeta"],
"sourceType": "script"
}
@@ -1,4 +1,4 @@
{
"sourceType": "module",
"plugins": ["dynamicImport", "importMeta"]
"plugins": ["importMeta"]
}
@@ -1,4 +1,4 @@
{
"sourceType": "module",
"plugins": ["dynamicImport", "importMeta"]
"plugins": ["importMeta"]
}
@@ -1,4 +1,4 @@
{
"sourceType": "module",
"plugins": ["dynamicImport", "importMeta"]
"plugins": ["importMeta"]
}

0 comments on commit baceca9

Please sign in to comment.