Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

165
Views
Genere múltiples páginas html con webpack y pug

Necesito generar varias páginas html diferentes, pero no puedo encontrar información normal y actualizada. Hay 2 plantillas de pug diferentes y necesito crear dos páginas separadas.

Traté de crearlo de diferentes maneras, el archivo es uno o ninguno.

Yo uso el paquete web 5.

 module.exports = { context: path.resolve(__dirname, "src"), mode: "development", entry: "./js/index.js", //точка выхода output: { filename: `./js/[name].[hash].js`, path: path.resolve(__dirname, "dist"), clean: true, publicPath: "", }, optimization: { splitChunks: { chunks: "all" }, }, plugins: [ require("autoprefixer"), new HtmlWebPackPlugin({ template: path.resolve(__dirname, "src/index.pug"), filename: path.resolve(__dirname, "build/index.html"), inject: false, chunks: ["index"], }), new HtmlWebPackPlugin({ template: path.resolve(__dirname, "src/step1.pug"), filename: path.resolve(__dirname, "build/step1.html"), inject: false, chunks: ["step1"], minify: { //удаляю коменты removeComments: true, //убираю пробелы collapseWhitespace: isProd, }, }), new HtmlWebpackPugPlugin(), ], module: { rules: [ //для обновления html при изменениях { test: /\.html$/, loader: "html-loader" }, { test: /\.pug$/, loader: "pug-loader", type:"asset/source", generator: { filename: "./[name][ext]", }, exclude: /(node_modules|bower_components)/, }, ], }, };

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Para generar páginas estáticas para el diseño y usar importaciones como en reaccionar, debe agregar un cargador. Enlace a continuación.

Enlace

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!