bananaoomarang / isomorphic-redux

Isomorphic Redux demo, with routing and async actions
https://medium.com/@bananaoomarang/handcrafting-an-isomorphic-redux-application-with-love-40ada4468af4
MIT License
455 stars 87 forks source link

Can't change output folder in webpack.dev.js #49

Closed thngdude closed 8 years ago

thngdude commented 8 years ago

Thanks for starting this project. It has been helpful with understanding isomorphic concepts.

I'm trying to change the output folder of the bundle in webpack.dev.js and it's not working.

output: {
      path: path.resolve(__dirname, 'dist'),
      publicPath: path.resolve(__dirname, 'dist')
    },

If I reference "/dist/bundle.js" in my html, it doesn't work, but "bundle.js" still works. It seems to ignore my configuration.

Any advice why this is happening? Thanks.

Dattaya commented 8 years ago

@thngdude additionally you need to pass public path to the webpackDevMiddleware as I did here webpack.dev.js#L38:

app.use(webpackDevMiddleware(compiler, {noInfo: true, publicPath: config.output.publicPath}));

also see if you don't need to change the base path of the express static middleware in server.jsx:


app.use(express.static(path.join(__dirname, 'static')));
thngdude commented 8 years ago

Works like a charm. Thanks!