gulp-babel and the strict mode

I use the "gulp-babel" before uglifying my js files. The module blocks the minification because a third party js script is not "strict mode" compilant. // Include gulp var gulp = require('gulp'); var baseDir = "./"; var jsour

React Photoswipe using the deleted babel 5 option

I am just starting to dabble in react and one of the first components I want is something to use photoswipe.js. (react photoswipe) It looks like there is a pretty decent one on npm, but I am running into a problem. When I run my storybook to start te

ES6 dynamic imports and instantiation of classes

I'm trying to figure out how to perform dynamic import of classes in ES6 one the server side (node.js with Babel). I would like to have some functionalities similar to what reflection offers in Java. The idea is to import all the classes in a specifi

Is there a way to match gpm npm projects?

Say I have two private (not available through npm) projects: projectA and projectB, both using Git as repos: ProjectA: Main project Javascript, ES6, JSX, etc.. Uses Webpack for build, minification, etc. Is compiled with Babel Includes Babel compiled

getDefaultProps with the React component class

When i declared getDefaultProps function inside Class which is inherit from React.Component this give Error like Below I setup condition in constructor for initialize props its undefined. import React from "react" import ReactDOM from "reac

Webpack returns a syntax error for JSX

When I attempted to use webpack to compile my react jsx code, I received the following error: ERROR in ./client/index.js Module parse failed: C:\Users\Gum-Joe\Documents\Projects\bedel/client\index.js Unexpected token (6:11) You may need an appropriat

Can not use hot reloading with babel, webpack and sass

I'm trying to use webpack-dev-server to have a hot-reload functionality for JS and SCSS files, but it fails to do so. I'm keep getting the same error: [WDS] App updated. Recompiling... [WDS] App hot update... [HMR] Checking for updates on the server.

The package reacts does not satisfy his brothers and sisters

Was trying to install sudo npm install react-datagrid --save sudo npm install react-datepicker --save Console Output npm ERR! peerinvalid The package react does not satisfy its siblings' peerDependencies requirements! npm ERR! peerinvalid Peer react-

Babel 6 transform-runtime: $ export is not a function

I'm trying to incorporate Babel's transform-runtime to make my code compatible with IE9. But since integrating it, the code won't even run on Chrome. I get the error Uncaught TypeError: $export is not a function on es6.object.define-property.js:3. Wi

Sourcemaps typescript using the Babel command line

I'm trying to get Babel to produce sourcemaps when run from the command line. The Babel docs around sourcemaps seem to be targeted more toward the gulp workflow and I'm not sure how that translates to the command line. I'm compiling my typescript usi

Unable to set read-only property '__esModule'

When compiling a React and Redux application with Webpack and Babel I get: Uncaught TypeError: Cannot assign to read only property '__esModule' of #<Object> In some older browsers (<= Chrome 1, Android 4, Safari 5). This issue seems to stem from

The conversion reacts from es5 to es6

I am converting an existing react project from es5 to es6. I have babel-preset-react. When I add es6 to myFile.js I get error: Unexpected token while parsing file. Code: var React = require('react'); var Input = require('../common/textInput') var Rev

Extension of the ES6 plugin to the jQuery prototype

I would like ask some help because i can't convert my classic jQuery (v2) plugin in ES6 with module and class. In ECMAScript 5, we can attach jQuery plugin into jQuery prototype like this : app.js - jQuery loaded via HTML <script> tag $.fn.myPlugin

Alt @decorators in React-Native

I am using the Alt library (Flux implementation) with React-Native. I really like the 'alt/utils/decorators' and 'alt/utils/connectToStores' but I cannot use these @decorators because the RN/Babel config doesn't seem to support it. I'm definitely not

What is the difference between these ES6 import methods?

This question already has an answer here: Javascript (ES6), export const vs export default 3 answers What is the difference between these import methods? Method 1: import {sum, pi} from "lib/math"; Method 2: import exp, {pi, e} from "lib/ma

The Babel file is copied without being transformed

I have this code: "use strict"; import browserSync from "browser-sync"; import httpProxy from "http-proxy"; let proxy = httpProxy.createProxyServer({}); and I have installed babel-core and babel-cli globally via npm. The poin

Importing CSS Files into Isomorphic React Components

I have a React application with Components written in ES6 - transpiled via Babel and Webpack. In some places I would like to include specific CSS files with specific Components, as suggested in react webpack cookbook However, if in any Component file

How to publish a module written in ES6 on NPM?

I was about to publish a module to NPM, when I thought about rewriting it in ES6, to both future-proof it, and learn ES6. I've used Babel to transpile to ES5, and run tests. But I'm not sure how to proceed: Do I transpile, and publish the resulting /

How to correctly compile a project with Babel and Grunt

I'm trying to play with Babel, but it doesn't work well for me. My project is simple |-project/ |---src/ |-----index.html |-----main.js |-----module.js |---Gruntfile.js |---package.json index.html <!DOCTYPE html> <html> <head lang="en&