I've intalled the express-generetor npm module and like how the project is structured with the jade files used as templates. However I also like to use the HTML-webpack-plugin which generates its own files, what is the best way to go about integrating both approaches?
Asked
Active
Viewed 1,689 times
1 Answers
0
- Step1:
Generate your html file(s):
module.exports = {
entry: {
'page1': './apps/page1/scripts/main.js',
'page2': './apps/page2/src/main.js'
},
output: {
path: __dirname,
filename: "apps/[name]/build/bundle.js"
},
plugins: [
new HtmlWebpackPlugin({
inject: true,
chunks: ['page1'],
filename: 'apps/page1/build/index.html'
}),
new HtmlWebpackPlugin({
inject: true,
chunks: ['page2'],
filename: 'apps/page2/build/index.html'
})
]
};
Step2: Add the generated html file(s) to your jade file
include ../../public/index.html

Priyanshu Chauhan
- 5,297
- 5
- 35
- 34