在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称:pbastowski/angular-meteor-babel开源软件地址:https://github.com/pbastowski/angular-meteor-babel开源编程语言:JavaScript 99.4%开源软件介绍:WARNING: this package is deprecated and no longer supportedI suggest users migrate to the native Babel and ng-annotate in one package
This package is meant to be used with Angular-Meteor and the corresponding If you are not working with angular-meteor then consider using Meteor's own Installmeteor add pbastowski:angular-babel What's in this package that's not in the ecmascript package?
Here is the list of Babel transformers in this package that are not in the
Please note that all es7 transformers are considered experimental, especially those at Stage 0 and 1. Custom configuration with babel.jsonPlace
Using |
file name | module name |
---|---|
client/app/app.js | client/app/app |
client/feature1/feature1.js | client/feature1/feature1 |
client/feature1/lib/xxx.js | client/feature1/lib/xxx |
client/lib/angular-messages.min.js | client/lib/angular-messages.min |
meteor add pbastowski:systemjs
System.import
to kick off your appNext, in the body section of your index.html
file you need to import the JS file that kicks off your application. For our example that file is client/index.js
.
<head>
<title>My App</title>
</head>
<body>
<app>Loading...</app>
<script>
System.import('client/index');
</script>
</body>
Below is a sample client/index.js
file. Remember that the innermost imports, those inside app
and feature1
, will be executed first. Then, the rest of the code in index.js
will be executed in the order it is listed in the file.
In the example below, first client/app/app
will be imported and executed followed by client/feature1/feature1
.
import 'client/app/app';
import 'client/feature1/feature1';
Meteor 1.1 or higher
When the module format is common
, which is the default for this Babel plugin, you don't actually have to do anything special as long as you don't import
or export
in your ES6 files. Babel will compile your code and output files that will be loaded and executed just like any normal non-compiled JS files would be.
If you use import ... from
or export
syntax in your ES6 code you may see errors in your dev console complaining about a missing require
. To get around that, I have created the package pbastowski:require
, which implements just enough of require
and module.exports
to enable you to export and import in Meteor apps.
Try it and see if it works for you:
meteor add pbastowski:require
See the Babel website
If Meteor refuses to update your package to the latest Meteor 1.2 version, you may have to convince it to do so like shown below. Change the version number to whatever version that you actually want.
meteor add pbastowski:[email protected]
The latest version of pbastowski:angular-babel
for Meteor 1.1 is 0.1.10
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论