reactjs - react js webpack bundling error for jsx files -
i'm doing small application. i'm using webpack bundle files, when tried execute webpack in command line error below, however, if entry extension './public/app.js' works perfectly. don't understand doing wrong. did @ other posts, different problem. appreciate if thank you.
error in ./public/app.jsx module build failed: referenceerror: [babel] /users/jair/desktop/development/react-test/public/app.jsx: unknown option: base.preset. check out http://babeljs.io/docs/usage/options/ more info @ logger.error (/users/jair/desktop/development/react-test/node_modules/babel-core/lib/transformation/file/logger.js:41:11) @ optionmanager.mergeoptions (/users/jair/desktop/development/react-test/node_modules/babel-core/lib/transformation/file/options/option-manager.js:216:20) @ optionmanager.init (/users/jair/desktop/development/react-test/node_modules/babel-core/lib/transformation/file/options/option-manager.js:338:12) @ file.initoptions (/users/jair/desktop/development/react-test/node_modules/babel-core/lib/transformation/file/index.js:216:65) @ new file (/users/jair/desktop/development/react-test/node_modules/babel-core/lib/transformation/file/index.js:137:24) @ pipeline.transform (/users/jair/desktop/development/react-test/node_modules/babel-core/lib/transformation/pipeline.js:46:16) @ transpile (/users/jair/desktop/development/react-test/node_modules/babel-loader/index.js:38:20) @ object.module.exports (/users/jair/desktop/development/react-test/node_modules/babel-loader/index.js:131:12)
module.exports = { entry: './public/app.jsx', output: { path: __dirname, filename: './public/bundle.js' }, resolve: { exensions: ['', '.js', '.jsx'] }, module: { loaders: [ { loader: 'babel-loader', query: { preset: ['react', 'es2015'] }, test: /\.jsx?$/, exclude: /(node_modules | bower_components)/ } ] } };
the correct option name presets
, not preset
:
query: { presets: ['react', 'es2015'] }
also, believe white spaces in exclude
regex need removed:
exclude: /(node_modules|bower_components)/
hope helps!
Comments
Post a Comment