diegodurli / flow-status-webpack-plugin

Run Flow Status on each Webpack build.
MIT License
98 stars 16 forks source link

ES6 error when trying to use plugin #6

Closed anarchang closed 8 years ago

anarchang commented 8 years ago

Hello,

I am running into trouble including the flow-status-webpack-plugin plugin in my webpack config file. I keep getting a syntax error that tells me I am not transpilling the plugin correctly.

Here is my webpack config file:

var FlowStatusWebpackPlugin = require('flow-status-webpack-plugin')

module.exports = {
  entry: [
    './app/index.js'
  ],
  module: {
    preLoaders: [
      {
        test: /\.jsx?$/,
        loaders: ['eslint'],
        indluce: __dirname + 'app'
      }
    ],
    loaders: [
      {
        test: /\.js$/,
        include: __dirname + '/app',
        loader: "babel-loader"
      },
      {test: /\.scss$/, include: __dirname + '/app/styles', loaders: ['style', 'css', 'sass']}
    ],
    plugins: [
      new FlowStatusWebpackPlugin()
    ]
  },
  output: {
    filename: "bundle.js",
    path: __dirname + '/build'
  },
}

And here is the error I am getting:

Users/anachang/IdeaProjects/live/live-ui/node_modules/flow-status-webpack-plugin/index.js:18
            shell.exec(flow + ' start ' + flowArgs, () => cb());
                                                     ^
SyntaxError: Unexpected token )
    at exports.runInThisContext (vm.js:73:16)
    at Module._compile (module.js:443:25)
    at Module._extensions..js (module.js:478:10)
    at Object.require.extensions.(anonymous function) [as .js] (/Users/anachang/IdeaProjects/live/live-ui/node_modules/babel-register/lib/node.js:134:7)
    at Module.load (module.js:355:32)
    at Function.Module._load (module.js:310:12)
    at Module.require (module.js:365:17)
    at require (module.js:384:17)
    at Object.<anonymous> (webpack.config.babel.js:1:31)
    at Module._compile (module.js:460:26)

I know this is not specific to this plugin, but any help would be wonderful. Thanks.

diegodurli commented 8 years ago

Hi @anarchang!

Thanks for reaching out. Well, in fact, I do believe it's related with this plugin. The wrong part is that we're assuming ES6 support, and that's wrong.

I'll provide a new version without ES6 support, allowing you to make it work.

Let you know as soon as it's done!

Thanks

diegodurli commented 8 years ago

Hi @anarchang!

You should be able to run it now. Could you please test it and provide some feedback?

Thank you!

anarchang commented 8 years ago

Thank you, @diegodurli. Now webpack runs without a problem. However, I do not get the output from the plugin. I put a type error in my code which shows up when running flow, but does not show up when running webpack. Maybe I set up my webpack config file incorrectly.

diegodurli commented 8 years ago

You're welcome @anarchang!

Hm, that's odd. Are you running webpack in watching mode? I ask you because I do run in watch mode and I can normally get the plugin output.

Not sure how I could help you with that.

anarchang commented 8 years ago

@diegodurli, no, I'm just running it manually when I change files. Thanks, I'll poke around and see what I can find.