Skip to main content
se añadieron 9 caracteres en el cuerpo
Origen Enlace

ERROR in ./src/index.js Module build failed (from ./node_modules/babel-loader/lib/index.js): Error: Plugin/Preset files are not allowed to export objects, only functions. In C:\Users\mmares\Documents\proyectos-telenet\boletin\node_modules\babel-preset-react\lib\index.js

ERROR in ./src/index.js Module build failed (from ./node_modules/babel-loader/lib/index.js): Error: Plugin/Preset files are not allowed to export objects, only functions. In C:\Users\mmares\Documents\proyectos-telenet\boletin\node_modules\babel-preset-react\lib\index.js

ERROR in ./src/index.js Module build failed (from ./node_modules/babel-loader/lib/index.js): Error: Plugin/Preset files are not allowed to export objects, only functions. In C:\Users\mmares\Documents\proyectos-telenet\boletin\node_modules\babel-preset-react\lib\index.js

ERROR in ./src/index.js Module build failed (from ./node_modules/babel-loader/lib/index.js): Error: Plugin/Preset files are not allowed to export objects, only functions. In C:\Users\mmares\Documents\proyectos-telenet\boletin\node_modules\babel-preset-react\lib\index.js

Origen Enlace
myrna
  • 29
  • 2
  • 10

Problemas para compilar webpack y Reactjs

este es el error que me arroja al tratar de hacer npm run build, y cuando hago npm start abre el código en blanco el problema parece estar en la entrada pero no puedo ver el error.

ERROR in ./src/index.js Module build failed (from ./node_modules/babel-loader/lib/index.js): Error: Plugin/Preset files are not allowed to export objects, only functions. In C:\Users\mmares\Documents\proyectos-telenet\boletin\node_modules\babel-preset-react\lib\index.js

const path = require('path');
const HtmlWebpackPlugin = require('html-webpack-plugin');

module.exports = {
    entry:  './src/index.js',
    output: {
        path: path.resolve('/dist'),
        filename: 'bundle.js'
    },
    resolve: {
        extensions: ['.js', '.jsx']
    },
    module: {
        rules: [
            {
                test: /(\.js|.jsx)$/,
                exclude: /node_modules/,
                use: {
                   loader: 'babel-loader'
               }
            },
            {
                test: /\.json$/,
                use: {
                    loader: 'json-loader'
               } 
            },
            {
                test: /\.css$/,
                use: {
                    loader: 'css-loader'
                }
            },
            {
                test: /\.html$/,
                use: {
                    loader: 'html-loader'
                }
            }
        ]
    },
    plugins: [
        new HtmlWebpackPlugin({
            template: './public/index.html',
            filename: './index.html'
        })
    ]
}