babeljs - Webpack import not transpiling Babel code -


i using react , webpack , weirdly when import class containing react component transpilation doesn't seem happen , get:

function class test extends _react2.default.component {         constructor() {             return _possibleconstructorreturn(this, object.getprototypeof(test).apply(this, arguments));         } 

etc.

however when define class inline not happen.

main required webpack file:

import react 'react'; import reactdom 'react-dom'; import { router, route, link, browserhistory } 'react-router';  // components import signup './components/test';  // styles import './styles/sass/materialize.scss';  reactdom.render(     <router history={browserhistory}>         <route path="/sign-up" component={signup} />     </router>,     document.getelementbyid('react-hook') ); 

webpack config:

import path "path"; import webpack 'webpack';  export default {     entry: [       path.resolve(__dirname, 'app/main.js')     ],     output: {         path: path.resolve(__dirname, 'public/dist'),         filename: 'bundle.js',     },     module: {         loaders: [             {                 test: /\.js?$/,                 exclude: /(node_modules|bower_components|lib)/,                 loader: 'babel-loader',                 query: {                     presets: ['react','es2015']                 }             },             {                 test: /\.s?css$/,                 loader: 'style!css!sass'             },             {                 test: /\.(woff|woff2|ttf|eot|svg)$/,                 loader: 'file-loader'             }         ]     },     plugins: [         new webpack.provideplugin({             jquery: "jquery"         })     ] }; 

this issue fixed reinstalling node_modules.


Comments