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

187
Views
¿Cómo puedo agrupar archivos Javascript y CSS en una carpeta específica con Webpack?

Estoy tratando de hacer que Webpack cree archivos Javascript y CSS en sus respectivas carpetas. Soy bastante nuevo en Webpack y parece que no puedo encontrar el complemento exacto que me ayude a hacer esto.

Esto es lo que estoy tratando de lograr:

 dist |___js | |__app.js | |__vendor.js | |___css | |__style.css | |___index.html

ingrese la descripción de la imagen aquí

El archivo de configuración:

 const path = require("path"); const HtmlWebpackPlugin = require("html-webpack-plugin"); const MiniCssExtractPlugin = require("mini-css-extract-plugin"); module.exports = { mode: "development", entry: { app: path.resolve(__dirname, "src/js/app.js") }, output: { path: path.resolve(__dirname, "dist/js"), filename: "[name].[contenthash].bundle.js", clean: true }, devtool: "inline-source-map", devServer: { contentBase: path.resolve(__dirname, "dist"), port: 5001, open:true, hot: true, watchContentBase: true }, plugins: [new HtmlWebpackPlugin({ filename: "main.html", template: path.resolve(__dirname, "src/index.html")}), new MiniCssExtractPlugin({ filename: "main.css" }) ], module: { rules: [ { test: /\.js$/, exclude: /node_modules/ }, { test:/\.css$/, use: [MiniCssExtractPlugin.loader, "css-loader"] } ] } }

Si no me he dejado claro, no dude en hacerme cualquier pregunta.

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

0

Puede establecer la propiedad de nombre de archivo que está pasando a MiniCssExtractPlugin a "css/style.css"

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!