Giter VIP home page Giter VIP logo

Comments (3)

THuRStoN avatar THuRStoN commented on August 26, 2024

It's working for me I've modified your script quite a bit but essentially I'm doing this for it to work.
I reference my images as:

scss

.logo {
  background-image: url('/assets/images/logo.png');
}

My make script does this:

webpack.make.js

      // Copy assets from the public folder
      // Reference: https://github.com/kevlened/copy-webpack-plugin

      new CopyWebpackPlugin( [ {
        from: config.output.assets_src,
        to: config.output.assets_dst
      } ] )

      // Assets directories are defined as
      assets_src: `${ __dirname }/src/assets/images`,
      assets_dst: `${ __dirname }/assets/images`,

from angularjs-webpack.

Foxandxss avatar Foxandxss commented on August 26, 2024

I figured this out but never updated the issue.

the css-loader (not sure about scss to be honest) does a require() with the images, so the path needs to be relative to the css file.

I am going to make some changes and remove the need of CopyWebpackPlugin (hopefully) with the html-loader so css and html images will have the same behavior.

from angularjs-webpack.

THuRStoN avatar THuRStoN commented on August 26, 2024

OK! cool!

from angularjs-webpack.

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.