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

208
Views
How to stop webpack from creating .js files even for scss entries?

I want to compile standalone scss files with webpack (and yes, even js files, but not scss files into js ones..):

const path = require('path');
const webpack = require("webpack");

module.exports = {
  mode: 'development',
  watch: true,
  
  entry: {
    shared: './src/shared.js',
    front_page: './src/front-page.js',
    front_page_style: '../scss/front-page.scss',
  },

  output: {
    filename: '[name].js',
    path: path.resolve(__dirname, 'dist'),
  },

  module: {
    rules: [
      {
        test: /\.scss$/,
        exclude: /node_modules/,
        use: [
          {
            loader: 'file-loader',
            options: { name: '../../css/[name].css' }
          },
          'sass-loader'
        ]
      }, // babel

    ] // rules
  } // module
};

The above code will generate .css files correctly, but will also generate /dist/*.js files from the scss entries (ex. front_page_style.js).

How to avoid this behaviour?

about 4 years ago · Juan Pablo Isaza
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!