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

don't handle an amd module #57

Closed
59naga opened this issue Jul 2, 2018 · 0 comments
Closed

don't handle an amd module #57

59naga opened this issue Jul 2, 2018 · 0 comments
Labels

Comments

@59naga
Copy link
Owner

59naga commented Jul 2, 2018

currently v0.3.0-pre.2 is destroy amd modules.

const code = `export default 'default-entry';`
const result = babelTransform(code, {
  presets: [['env', {modules: 'amd'}]],
  plugins: [
    './src/index.js'
  ]
})
console.log(result.code)

becomes

define(['exports'], function (exports) {
  'use strict';

  Object.defineProperty(exports, "__esModule", {
    value: true
  });
  exports.default = 'default-entry';
  module.exports = exports.default; // "module" is not defined in browser
});

don't add module.exports.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant