Next article:
Create a file underneath the Webpack-test1 folder Hello.js
And then hit the code at the command line.
Webpack Hello.js Hello.bundle.js
First enter the name of the file you want to package and then the file name after the package
After the package is successful, you will see a code like this: a hash,webpack version number, and the time it takes to pack.
Next we create a bye.js file, which includes a reference to the Hello.js
Create a simple function in bye
References to Bye.js in Hello.js are referenced in require way
Then execute the code again and there will be two modules
Next we create a CSS file and reference it in Hello.js
However, you need to install two loader before referencing, because the webpack itself is not a CSS file support
Next, refer to in Hello.js
Next, create a demo.html file to show the entire page
We can see the effect on the page!
So you see that the style in the page is referenced by a style tag.
Is that not every time we have to cite this?
No, we can do this at the command line:
Webpack the small case of beginners ' notes Demo1