Coder Social home page Coder Social logo

Comments (8)

guybedford avatar guybedford commented on August 12, 2024

Is this a cross-origin stylesheet again?

If so, you need to force 'useLinks' when you're doing cross-origin.

Actually, it should use them anyway. Sorry - invalid argument there.

from require-css.

DaveStein avatar DaveStein commented on August 12, 2024

Yeah I'm about to force that to true via config. I was just a little unclear. So we're saying until things are set, useLinks set to true via config will only be cross-domain-safe way until we remove that guard? Also if I do

require.config({
// Where does the config example from docs go?
});

I tried putting it with or without the config key since I'm already in a config function. I also tried putting it under map since I have other plugin configs laying in there.

from require-css.

DaveStein avatar DaveStein commented on August 12, 2024

Ah I just saw your edit? Are you saying that I shouldn't need to force?

from require-css.

guybedford avatar guybedford commented on August 12, 2024

Yes exactly - when loading an external stylesheet it is supposed to default to links. It seems it is this check which was failing.

The update should cause this check to work now (hopefully).

Also if you do use configuration, it should look like -

  require.config({
    config: {
      'require-css/css': {
        useLinks: true
      }
    }
  });

from require-css.

DaveStein avatar DaveStein commented on August 12, 2024
require.config({
  baseUrl: '/assets/js',
  paths: {
    'styles': '../css',
    'templates': '../templates'
  },
  config: {
    'require-css/css': {
      useLinks: true
    }
  },
  map: {
    '*': {
      'css': 'require/css',
      'hgn': 'require/hgn'
    },
    'require/hgn': {
      'hogan': 'require/hogan',
      'text': 'require/text'
    }
  }
});

Followed by console.log( module.config().useLinks ); inside css.js is yielding undefined

from require-css.

guybedford avatar guybedford commented on August 12, 2024

You'd need to use require/css: {.. config ..} in your case.

from require-css.

DaveStein avatar DaveStein commented on August 12, 2024

D'oh

from require-css.

guybedford avatar guybedford commented on August 12, 2024

I believe this should be working now. Let me know if you spot anything else!

from require-css.

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.