Create a file: index.pug with some dummy data.Install pug, pug-loader, html-webpack-plugin.Next let’s make webpack to read pug files and to load them in the distribution folder. Even if we don’t need it for this short tutorial, it’s good to know how you can do it. With this, we defined an entry and output point for our application, the port for the development server and we created a simple boilerplate to figure it out whether we run the the webpack command in production or development mode. In order to do this differentiation between production and development, then we must write in the following way const path = require('path') const config = If we want to run the webpack command both in development mode and production mode using our scripts then we must create a separate config object with the common configuration and then based on the arguments of the webpack command we will add diferent rules.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |