sunmingtao / sample-code

3 stars 4 forks source link

"npx webpack" generates empty dist/main.js #231

Closed sunmingtao closed 3 years ago

sunmingtao commented 3 years ago

src/index.js

import helloWorld from './hello-world.js';

helloWorld();

src/helloworld.js

function helloWorld() {
    console.log('Hello world');
}

export default helloWorld;

Run npx webpack main.js under dist is empty

sunmingtao commented 3 years ago

Rookie mistake. Turns out I forgot to save index.js and helloworld.js. I am not in a habit of pressing Ctrl+s because I primarily use Intellij.