Questions tagged [babel-loader]

718 questions
0
votes
2 answers

Imports not working inside webpack

I am new to webpack, so sorry if I am missing something super evident... I have the following structure: adex_js ---- app.jsx (entry point) ---- TestComponent.jsx In app.jsx I have: import TestComponent from './TestComponent' I get: ERROR in…
Gioia Fueter
  • 605
  • 1
  • 5
  • 16
0
votes
1 answer

Webpack bundle JS without React or React Dom

I'd like to use webpack to bundle my JS together for a React component but without including React or React Dom, just my own React code. The idea is so that I can load React or React Dom separately on the webpage with RequireJS as I'm adding the…
Holly
  • 7,462
  • 23
  • 86
  • 140
0
votes
0 answers

Webpack babel-loader output size

I have a lazy chunkhash output from my application and on closer inspection i cant work out why the login.vue file seems to appear twice. Once as itself and once within babel-loader. Im using webpack-visualizer to view this. The total size of the…
Peter I
  • 843
  • 1
  • 9
  • 31
0
votes
1 answer

Babel breaking my WebPack Build

I'm still new to WebPack, but I have tried everything I know of to get Babel running in my WebPack build. No luck. I'm Tapped out. I know it's in here somewhere, but I cant find it. :( The Error Message sleeper@sleeper-dev:~/WebPack_Projects/es6$…
sleeper
  • 3,446
  • 7
  • 33
  • 50
0
votes
1 answer

Webpack jsx module loader fails when include given

I boiled my problem down to a minimum test. I have an App.js file which contains a bit of jsx and which is to be compiled to ./bundle.js: // App.js module.exports = () =>
My webpack config seems quite standard with module.exports = { …
Michel H.
  • 301
  • 1
  • 11
0
votes
0 answers

transpiled code (babel) seems not working in Browser

Hi I'm working on an existing app which needs enhancements. The app is built using angularJS, Babel, webpack. I struggled running the app locally and finally succeeded in running it after making changes to how we call a basedirective (like below)…
Rajesh p
  • 11
  • 4
0
votes
1 answer

Module parse failed: Unexpected token webpack@3 babel angularJS

webpack/share.js const path = require('path') const ExtractTextPlugin = require('extract-text-webpack-plugin') const HtmlWebpackHarddiskPlugin = require('html-webpack-harddisk-plugin') const HtmlWebpackPlugin = require('html-webpack-plugin') const…
0
votes
1 answer

how to get a javascript class import without loader

babel is configured with: { "presets": [ ["env", { "modules": false }], "stage-2" ], "plugins": ["transform-runtime"], "comments": false, "env": { "test": { "presets": ["env", "stage-2"], "plugins": [ "istanbul" ] …
roberto tomás
  • 4,435
  • 5
  • 42
  • 71
0
votes
2 answers

Bundled script failed to load in browser

Webpack compilation was succesful but fails to load in the browser. On checking the web console, I discovered some modules could not be accessed in _webpack_require_. When I changed the es6 import syntax to require in the concerned module, the error…
0
votes
1 answer

How to make babel-loader ignore my dynamic URL

I have a dynamic URL that grabs images from our server in an image tag that throws an error when being processed by babel-loader. This is some of the error message being thrown so that I know it's from the babel-loader specifically: Error:…
0
votes
0 answers

Babel not transpiling ES6 module in node_modules despite proper exclude

In a react project I used react-boilerplate but had private modules to include in the frontend that needed transpiling. In order for babel to transpile those I set exclude to the following function in the webpack config that relates to babel: rules:…
0
votes
2 answers

Unexpected Token Import, babel-loader not working?

ERROR in ./app/main.js Module parse failed: /Users/dz2048/myapplication/app/main.js Line 1: Unexpected token You may need an appropriate loader to handle this file type. | import React from 'react'; I cannot figure out why I'm getting this…
dzny
  • 364
  • 1
  • 7
0
votes
1 answer

Correct way to configure babel-loader in webpack for HMR

About a week ago I ran into a problem while adding HMR to my project, the problem was that it just didn't work, the console showed HMR Enabled and also detected changes on the files, but it didn't re-render the view, the console would log: [HMR]…
0
votes
1 answer

Unexpected token. You may need an appropriate loader to handle this file type

I got an error as below when I try to use material-ui-dropzone in ReactJs. ERROR in ./node_modules/material-ui-dropzone/src/index.js Module parse failed:…
Buddhi
  • 839
  • 10
  • 15
0
votes
2 answers

Babel Loader and Webpack + React syntax error

I'm using React + Webpack and Babel Loader for my project. When I'm trying to generate the bundle code, the following error is thrown (for every reducer I have when using {... state}): @ ./src/reducers/index.js 29:21-47 @ ./src/index.js ERROR in…
Moldovan Andrei
  • 305
  • 1
  • 6
  • 19