Giter Site home page Giter Site logo

Comments (12)

MrBackKom avatar MrBackKom commented on August 20, 2024 105

@shama I have find the cause of the problem

loaders:[{
                test:'/\.css$/',
                loader:'style!css!'
        }]

It should be

loaders:[{
                test: /\.css$/,
                loader:'style!css!'
        }]

It's my mistake,thanks a lot

from letswritecode.

RamiroIsBack avatar RamiroIsBack commented on August 20, 2024 19

hello there! @MrBackKom solution worked for me thanks!, with just one slight variation:
If you get the latest version of the css-loader, doesn't allow you to write:

loaders:[{
                test: /\.css$/,
                loader:'style!css!'
            }]

on the webpack.config.js instead you have to write:

{
        test: /\.css$/,
        loader:[ 'style-loader', 'css-loader' ]
      }

It is here, in the usage section, in their repo : (https://github.com/webpack-contrib/css-loader)

from letswritecode.

dkarpov avatar dkarpov commented on August 20, 2024 6

this should help
{
test: /\.(css|less)$/,
use: ["style-loader", "css-loader", "less-loader"]
}

from letswritecode.

 avatar commented on August 20, 2024 5

@dsslimshaddy What version of extract-text-webpack-plugin are you using, I am seeing this on ^3.0.0.

from letswritecode.

matinsoleil avatar matinsoleil commented on August 20, 2024 5

Work for me

 module: {
    rules: [
      {
        test: /\.js$/,
        include: path.resolve(__dirname, 'src'),
        exclude: /(node_modules|bower_components|build)/,
        loader: 'babel-loader'
      },
      {
        test: /\.(css|less)$/,
        use: ["style-loader", "css-loader"]
      }
    ]
  },

from letswritecode.

imerkle avatar imerkle commented on August 20, 2024 1

Yes its fixed. Problem was with extract-text-webpack-plugin . i was using older version. after upgrading to latest it was fixed

from letswritecode.

MrBackKom avatar MrBackKom commented on August 20, 2024

I have installed the style-loader & css-loader by parameter --save-dev
and this is the json content below.

{
  "name": "webpack",
  "version": "1.0.0",
  "description": "test webpack",
  "main": "index.js",
  "scripts": {
    "start": "webpack-dev-server ./index.js"
  },
  "author": "",
  "license": "ISC",
  "devDependencies": {
    "css-loader": "^0.23.1",
    "jquery": "^2.2.0",
    "style-loader": "^0.13.0",
    "webpack": "^1.12.10",
    "webpack-dev-server": "^1.14.0"
  }
}

from letswritecode.

shama avatar shama commented on August 20, 2024

Oh great catch @MrBackKom! Glad you figured it out!

from letswritecode.

imerkle avatar imerkle commented on August 20, 2024

cant get it to work still

from letswritecode.

shama avatar shama commented on August 20, 2024

@dsslimshaddy You config or error might be slightly different. Feel free to post it and we might be able to help.

from letswritecode.

paraofheaven avatar paraofheaven commented on August 20, 2024

@dsslimshaddy,but I want to use webpack 1.0, the latest version need webpack 2.0,what should I do?

from letswritecode.

HimanshuRawani avatar HimanshuRawani commented on August 20, 2024

(css|less) worked for me too. But m bit unsure that, if less file are be picked up by less-loader, or traditionally it is being managed by css-loader only. Could anyone please comment in here to clarify?

from letswritecode.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.