lasso-js / lasso-less

Lasso.js plugin to support compilation of less dependencies
7 stars 10 forks source link

referencing external css throws error #20

Closed sampology closed 8 years ago

sampology commented 8 years ago

browser.json

{
  "dependencies": [
    "require: jquery",
    "require: marko-widgets",
    { "type": "css", "url": "//maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" },
    { "type": "js", "url": "//maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js" }
  ]
}

lasso config

require('lasso').configure({
  plugins: [
    {
      plugin: 'lasso-less',
      config: {
        extensions: ['less', 'css', 'config']
      }
    },
    'lasso-less', // Allow Less files to be rendered to CSS
    'lasso-marko' // Allow Marko templates to be compiled and transported to the browser
  ],
  outputDir: __dirname + '/static', // Place all generated JS/CSS/etc. files into the "static" dir
  bundlingEnabled: isProduction, // Only enable bundling in production
  minify: isProduction, // Only minify JS and CSS code in production
  fingerprintsEnabled: isProduction, // Only add fingerprints to URLs in production
  bundles: [ // Create separate JS bundles. Only needed to guage the size of each library.
    {
      name: 'jquery',
      dependencies: [
        'require: jquery' // Put all the jQuery code into this bundle
      ]
    },
    {
      name: 'marko',
      dependencies: [
        'require: marko'
      ]
    },
    {
      name: 'marko-widgets',
      dependencies: [
        'require: marko-widgets'
      ]
    },
    {
      name: 'events',
      dependencies: [
        'require: events'
      ]
    }
  ]
});

error

/home/www/pause/node_modules/lasso/lib/dependencies/Dependency.js:222
                        throw new Error('Dependency of type "' + this.type + '" does not support property "' + k + '". Package: ' + getPackagePath(this));
                        ^

Error: Dependency of type "css" does not support property "url". Package: /home/www/pause/src/resources/global/browser.json
    at Ctor.Dependency.init.set (/home/www/pause/node_modules/lasso/lib/dependencies/Dependency.js:222:31)
    at Ctor.Dependency (/home/www/pause/node_modules/lasso/lib/dependencies/Dependency.js:71:10)
    at new Ctor (/home/www/pause/node_modules/lasso/lib/dependencies/DependencyRegistry.js:200:24)
    at Object.DependencyRegistry.registerRequireType.mixins.getRequireHandler.createDependency (/home/www/pause/node_modules/lasso/lib/dependencies/DependencyRegistry.js:523:16)
    at go (/home/www/pause/node_modules/lasso/lib/dependencies/DependencyRegistry.js:597:39)
    at asyncNormalizeCallback (/home/www/pause/node_modules/lasso/lib/dependencies/DependencyRegistry.js:573:13)
    at globNormalizer (/home/www/pause/node_modules/lasso/lib/dependencies/glob.js:55:9)
    at go (/home/www/pause/node_modules/lasso/lib/dependencies/DependencyRegistry.js:583:25)
    at asyncNormalizeCallback (/home/www/pause/node_modules/lasso/lib/dependencies/DependencyRegistry.js:573:13)
    at globNormalizer (/home/www/pause/node_modules/lasso/lib/dependencies/glob.js:55:9)
    at go (/home/www/pause/node_modules/lasso/lib/dependencies/DependencyRegistry.js:583:25)
    at asyncNormalizeCallback (/home/www/pause/node_modules/lasso/lib/dependencies/DependencyRegistry.js:573:13)
    at globNormalizer (/home/www/pause/node_modules/lasso/lib/dependencies/glob.js:55:9)
    at go (/home/www/pause/node_modules/lasso/lib/dependencies/DependencyRegistry.js:583:25)
    at Object.DependencyRegistry.registerRequireType.mixins.getRequireHandler.normalizeDependencies.handleNormalizedDependency [as normalizeDependencies] (/home/www/pause/node_modules/lasso/lib/dependencies/DependencyRegistry.js:608:9)
    at Object.DependencyList.normalize (/home/www/pause/node_modules/lasso/lib/DependencyList.js:43:38)
    at Object.__dirname.LassoManifest.LassoManifest.getDependencies (/home/www/pause/node_modules/lasso/lib/LassoManifest.js:138:27)
    at walkManifest (/home/www/pause/node_modules/lasso/lib/dependency-walker.js:72:18)
    at Object.<anonymous> (/home/www/pause/node_modules/lasso/lib/dependency-walker.js:145:25)
    at notifyCallbacks (/home/www/pause/node_modules/raptor-async/AsyncValue.js:76:35)
    at Object.AsyncValue.resolve (/home/www/pause/node_modules/raptor-async/AsyncValue.js:262:9)
    at /home/www/pause/node_modules/lasso/lib/dependencies/Dependency.js:349:36
patrick-steele-idem commented 8 years ago

New version published: lasso-less@2.3.0

Please let me know if you see any issues. Thanks for reporting the problem.