All Questions

61
votes
8answers
75053 views

Webpack how to build production code and how to use it

I am very new to webpack, I found that in production build we can able to reduce the size of overall code. Currently webpack builds around 8MB files and main.js around 5MB. How to reduce the size of c...
18
votes
3answers
9595 views

Getting "Error: `output.path` needs to be an absolute path or `/`"

I am new to JS development, in an attempt to hot load changes using webpack-dev-server I keep above exception. The exact stack is: Error: `output.path` needs to be an absolute path or `/`. at Object....
92
votes
7answers
97772 views

How to make the webpack dev server run on port 80 and on 0.0.0.0 to make it publicly accessible?

I am new to the whole nodejs/reactjs world so apologies if my qs sounds silly. So I am playing around with this reactjs app here: https://github.com/bebraw/reactabular Whenever I do a "npm start" it ...
30
votes
2answers
12690 views

Mocha tests don't run with Webpack and mocha-loader

Background I am porting some npm scripts to Webpack loaders to better learn how Webpack works and I’ve got everything working except for my Mocha tests: I have one failing test, but it is not showi...
59
votes
7answers
10855 views

Mocha testing failed due to css in webpack

I'm new to Mocha and I am trying to use it to test a simple React component. The test would pass if the react component doesn't have any CSS styling but throws a syntax error if the tag within the Rea...
40
votes
3answers
18887 views

webpack can't find module if file named jsx

As I write webpack.config.js like this module.exports = { entry: './index.jsx', output: { filename: 'bundle.js' }, module: { loaders: [{ test: /\.jsx?$/, exclude: /node_m...
10
votes
3answers
15638 views

Webpack + Babel: Couldn't find preset "es2015" relative to directory

I have a React project using Webpack and Babel. When I created it on an office computer, the Webpack ran fine. When I cloned the project onto my personal computer, it gave the following error: ERROR ...
39
votes
5answers
20051 views

Webpack-dev-server doesn't generate source maps

I use babel-loader, but can't figure out how to generate or where find source maps for transpiled files. I tried eval-source-map, inline-source-map, source-map. webpack.config.js const BowerWebpackP...
12
votes
1answers
6008 views

historyApiFallback doesn't work in Webpack dev server

I use Webpack dev server and browserHistory in React Router to manipulate with urls by HTML5 History API. historyapifallback-option does not work in my webpack config file. After refreshing http://loc...
7
votes
2answers
1351 views

nested url routing using react-router and webpack dev server

I'm having some issues working with react-router and webpack-dev-server to achieve nested url routing. webpack.config.js output: { path: path.resolve(__dirname, 'build'), publicPath: "/", &l...

Previous Next