reactjs - Webpack, React & Mocha test: Missing class properties transform -
i have been having issue on week now. code runs fine in browser , no errors, when run mocha test
, error of missing class properties transform
. installed via npm , deleted packages , re-installed them still nothing. have read numerous posts on here (i.e. error: missing class properties transform) , still come error. missing here? help.
webpack.config.js:
... module: { loaders: [ { test: /\.(js|jsx)$/, include: [ path.resolve(__dirname, "public/app") ], exclude: /node_modules/, loaders: [ 'react-hot', 'babel?presets[]=react,presets[]=es2015,presets[]=stage-0' ], loader: 'babel', query: { "plugins": ['transform-decorators-legacy'] } }, { test: /\.json?$/, loader: 'json' }, { test: /\.css$/, loaders: ['style', 'css'] }, { test: /\.less$/, loader: extracttextplugin.extract('style-loader', 'css-loader!less-loader') } ] } ...
.babelrc:
{ "presets": ["react", "es2015", "stage-0"], "plugins": [ "transform-class-properties" ] }
package.json:
... "babel-loader": "^6.2.4", "babel-plugin-react-transform": "^2.0.2", "babel-plugin-transform-class-properties": "^6.11.5", "babel-preset-es2015": "^6.9.0", "babel-preset-react": "^6.5.0", "babel-preset-react-hmre": "^1.1.1", "babel-preset-stage-0": "^6.5.0", "babel-preset-survivejs-kanban": "^0.3.3", "babel-relay-plugin-loader": "^0.9.0", ... "css-loader": "^0.23.1", ... "style-loader": "^0.13.1", ...
i can give additional details if needed. if seeing codebase whole help, can see here: https://github.com/dandeller/sputnik
thanks again guys =)
mocha's not looking @ webpack.config, it's separate system. tell mocha load tests through babel need flag it.
mocha test --require babel-core/register
Comments
Post a Comment