Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Output amd/es2017 #62

Merged
merged 1 commit into from
Aug 16, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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