Giter VIP home page Giter VIP logo

requirejs-babel-plugin's People

Contributors

esbenp avatar icecreamliker avatar robertcz avatar skhilko avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

requirejs-babel-plugin's Issues

Unable to use Babel6

modules was deprecated in Babel 6. I suggest removing it from the default options and then making the user able to choose between Babel 5 or Babel 6 by setting the appropriate settings in main.js

See PR #3

Babel6 source maps incorrect when nested

Hi,

Facing an issue with this plugin regarding source maps. I am not sure if this is a babel-core issue or what but figured I would start here.

In my require config I am importing babel like so:

'es6': "libs/node_modules/requirejs-babel-plugin/es6",
'babel': "libs/node_modules/babel-standalone/babel"

When I require es6!my_module_name it works correctly and a source map is generated. However if my_module_name has dependencies such as

define([
'backbone',
'text!app/template.html',
'es6!app/dep1',
'es6!app/dep2',
'es6!app/dep3',
'webui-popover'
], function(Backbone, template, dep1, dep2, dep3, webuiPopover) 

(and maybe dep1, 2, or 3 has the same sort of structure)

The source map reported by chrome will be the incorrect name. For example, if in dep1 I have a console.log('hi'); chrome will say the console.log is coming from dep3 even though it should be dep1. I have noticed if I remove dep3 from the define, the above statement will then then say the console.log is coming from dep2.

Should this be working?

Let me know if something is unclear. If needed I can try and put together a sample

Babel option resolveModuleSource not working

Babel option resolveModuleSource to insert es6! prefix to imported dependencies is not working because deep clone of babel config with JSON stringify/parse will remove functions from options. Quick fix would be something like

                babelOptions = JSON.parse(JSON.stringify(config.babel));
                babelOptions.resolveModuleSource = config.babel.resolveModuleSource

See also issue mikach/requirejs-babel#26

How to use require.config({paths:{...}}) with this plugin?

I am transpiling ES6 files using Gulp to activate Babel (with plugin 'transform-es2015-modules-amd').
I am unable to specify logical paths for requirejs, for example:

require.config({
  paths: {
    'react': '../lib/react.min.js',
    'react-dom': '../lib/react-dom.min.js',
  },
})

I am hoping this plugin can help me to specify these requirejs options into the ES5 files produced by Babel.
Where exactly should I put the config info?

If I try naively to put it at the start of the first ES6 file, Babel moves the require.config instruction inside the define block, whereas I need it to remain outside.

Incorrect source file name in source maps

The file extension is missing in the processed files names when viewing the sources in a browser with enabled JavaScript source maps.

Please see the screenshot. enrollment is a JavaScript file.
screen shot 2016-08-22 at 8 23 27 pm

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.