Skip to content

Commit

Permalink
Merge pull request #62 from glimmerjs/amd-es2017
Browse files Browse the repository at this point in the history
Output amd/es2017
  • Loading branch information
dgeb committed Aug 16, 2019
2 parents 648c069 + 23eb375 commit 313d09a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
6 changes: 6 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,11 @@ module.exports = function(options = {}) {
let types = selectTypesFromTree(es2017ModulesAndTypes);
let es5Modules = toES5(es2017Modules, { sourceMap: 'inline' }, options.buildType);
let es5Amd = toNamedAmd(es5Modules, { namespace: projectName, external });
let es2017Amd = toNamedAmd(es2017Modules, {
namespace: projectName,
external,
lang: 'es2017'
});
let es2017CommonJs = toNamedCommonJs(es2017Modules);
let es5CommonJs = toNamedCommonJs(es5Modules);

Expand All @@ -157,6 +162,7 @@ module.exports = function(options = {}) {
annotation: 'modules-es5'
}));
trees.push(es5Amd);
trees.push(es2017Amd);
trees.push(funnel(es2017CommonJs, {
destDir: 'commonjs/es2017',
annotation: 'commonjs-es2017'
Expand Down
3 changes: 2 additions & 1 deletion lib/to-named-amd.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ module.exports = function toNamedAMD(tree, options = {}) {
let namespace = options.namespace || getPackageName(process.cwd());
let plugins = options.plugins || [];
let entry = options.entry || path.join(namespace, 'index.js');
let dest = options.dest || path.join('amd', 'es5', namespace.replace(/\//g, '-').replace('@', '') + '.js');
let lang = options.lang || 'es5';
let dest = options.dest || path.join('amd', lang, namespace.replace(/\//g, '-').replace('@', '') + '.js');
let external = options.external || [];
let onwarn = options.onwarn || function(warning) {
// Suppress known error message caused by TypeScript compiled code with Rollup
Expand Down

0 comments on commit 313d09a

Please sign in to comment.