reactjs - Load react-multiselect-two-sides jsx plugin on React -
i trying load react-multiselect-two-sides, error:
module parse failed: c:\dev\wms.servico\application server\web\node_modules\react-multiselect-two-sides\index.jsx unexpected token (190:4) may need appropriate loader handle file type. syntaxerror: unexpected token (190:4)
i configuring babel , webpack load, error persists.
here dependencies:
"devdependencies": { "babel-cli": "^6.18.0", "babel-core": "^6.14.0", "babel-loader": "^6.2.5", "babel-plugin-transform-class-properties": "^6.18.0", "babel-preset-es2015": "^6.14.0", "babel-preset-react": "^6.3.13", "babel-preset-stage-2": "^6.13.0", "css-loader": "^0.25.0", "react-hot-loader": "^1.3.0", "style-loader": "^0.13.1", "webpack": "^1.14.0", "webpack-dev-server": "^1.15.0" }, "dependencies": { "axios": "^0.15.3", "bootstrap": "^3.3.7", "jquery": "^3.1.1", "moment": "^2.17.1", "query-string": "^4.3.1", "react": "^15.3.1", "react-bootstrap": "^0.28.5", "react-bootstrap-daterangepicker": "^3.2.2", "react-bootstrap-sweetalert": "^3.0.0", "react-clockpicker": "^0.1.1", "react-dom": "^15.3.1", "react-multiselect-two-sides": "^0.11.0", "react-notify": "^2.0.1", "react-notify-toast": "^0.1.4", "react-paginate": "^4.1.1", "react-router": "^2.8.0", "react-search": "^2.0.5", "react-select": "^1.0.0-rc.2", "react-tap-event-plugin": "^1.0.0", "sweetalert2": "^6.4.0" }
here .babelrc
{ "presets": [ "es2015", "react", "stage-2" ], "plugins": ["transform-class-properties"] }
here webpack.config.js
const webpack = require('webpack'); const path = require('path'); const absolutepath = path.resolve(__dirname); module.exports = { entry: './views/app/index.js', output: { path: './react-dist', filename: 'app.bundle.js' }, devtool: 'source-map', module: { loaders: [{ test: /\.js$/, exclude: /node_modules/, loaders: ['babel-loader'] }, { test: /\.css$/, loader: "style!css" },{ test: /\.jsx?$/, // match both .js , .jsx files exclude: /node_modules/, loader: "babel", query: { presets:['react'] } }] }, resolve: { alias: { 'modulos': absolutepath + '/node_modules', 'layouts': absolutepath + '/views/app/layouts', 'paginas': absolutepath + '/views/app/paginas', 'componentes': absolutepath + '/views/app/componentes' }, extensions: ['', '.js', '.jsx'] } };
i trying use componet this:
import react, { component } 'react'; import multiselecttwosides 'react-multiselect-two-sides';
regards,
Comments
Post a Comment