sekoyo / universal-react

A universal react starter, with routing, meta, title, and data features
242 stars 50 forks source link

ES6 in webpack.prod.config #1

Closed d0ruk closed 9 years ago

d0ruk commented 9 years ago

Hello,

I solved it with a babel-register.js at root and modifying changing the "npm run build" script's config to "babel-register.js"

require('babel/register');
module.exports = require('./webpack.production.config.js');
"build": "NODE_ENV=production webpack --config ./babel-register.js --progress --profile --colors"
sekoyo commented 9 years ago

HI @Norm- I was just thinking about this - it will work with Node v4 but not older versions before the io.js merge. It's actually pretty unnecessary to have the "Clean" plugin as a class so I think I might just write it as an ES5 plugin. Thanks for the heads up. My advice is to upgrade your version of node though :)

sekoyo commented 9 years ago

Actually I think that soon nobody will be using pre Node v4 for much longer (latest is 4.2.1), I recommend you update too. So leaving this as a class as it's cleaner. Thanks for the input.