CodeCoupler Webpack Getting Started
After setup you can start writing your code in the folder
src and put asset files into the folder
static. You can organize the files inside these folders as always you want.
Keep this in mind that only the file
src/index.js will be used as single entry point. You should
start here writing your code and import all the other needed modules and stylesheets.
A last important Note: Do not put anything into the folder
dist. This folder will wiped everytime
you compile. Use only the folders
Let's try an example. Put this code into the
Now start a terminal and type:
The compilation will start and right after that a browser. You should see now the ingenious message "Hello World".
If you go back into the editor, change the message and save the file the recompilation will start automatically and the browser reloads the page with your new message.
Let's stop this watch mode with Ctrl-C and type the following:
The compilation will start and a folder
dist will appear. Inside of this folder you will see a
.js file an
index.html and a
favicon folder. If you load the
index.html in your
browser you see your message again.
To get an overview, we recommend you to take a look at the walkthrough.