0

Here is my folder structure:

config
 |--webpack.config.js
entry
 |--app.js
output

And here is my part of my webpack.config.js file content:

module.exports = {
    context: path.join(__dirname, '..'),
    entry: {
        app: './entry/app.js'
    },
    output: {
        path: path.resolve('.', 'output'),
        filename: '[name].bundle.js'
    },

When I run the webpack, no file output in the output folder. However, the terminal show no error, also the app.bundle.js seems already been ouputed.

Hash: 0d0e4e77f57e49724b60
Version: webpack 2.6.1
Time: 22416ms
        Asset    Size  Chunks                    Chunk Names
app.bundle.js  389 kB       0  [emitted]  [big]  app
chunk    {0} app.bundle.js (app) 1.1 MB [entry] [rendered]
   [26] ./~/react/lib/React.js 3.34 kB {0} [built]
  [100] ./~/react/react.js 55 bytes {0} [built]
  [116] ./entry/app.js 465 bytes {0} [built]
  [117] (webpack)-dev-server/client?http://localhost:8080 5.64 kB {0} [built]
  [124] ./~/events/events.js 8.45 kB {0} [built]
  [151] ./~/react-dom/index.js 58 bytes {0} [built]
  [262] ./~/strip-ansi/index.js 161 bytes {0} [built]
  [265] ./~/url/url.js 23.1 kB {0} [built]
  [267] (webpack)-dev-server/client/overlay.js 3.61 kB {0} [built]
  [268] (webpack)-dev-server/client/socket.js 872 bytes {0} [built]
  [269] (webpack)/hot/emitter.js 89 bytes {0} [built]
  [270] ./src/scripts/module_b_es6.js 128 bytes {0} [built]
  [271] ./src/scripts/react_components/head.jsx 2.32 kB {0} [built]
  [274] ./src/styles/style.css 911 bytes {0} [built]
  [275] multi (webpack)-dev-server/client?http://localhost:8080 ./entry/app.js
0 bytes {0} [built]
     + 261 hidden modules
webpack: Compiled successfully.

So what's wrong with my code ?

1 Answer 1

1

It looks like you're running webpack-dev-server, which compiles your bundle but does not write it to disk (it keeps it in memory).

You have to run webpack to get the output files.

webpack --config config/webpack.config.js
Sign up to request clarification or add additional context in comments.

1 Comment

HI Micheal, can you specify what memory? My program is pulling it from disk when I use webpackdevmiddleware. e.g. Lets say if I empty my bundle.js then my browser is actually pulling an empty file even when the server is on, it can watch file changes and successfully compiles it but the browser doesn't reflect them. Feels like the browser is not pulling it from any memory of any sort.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.