JSFiddle - React, Tailwind, and code Playground

by Pete Nykänen

JavaScript

require.config({
  paths: {
    underscore: "vendor/underscore/underscore",
    backbone: "vendor/backbone/backbone",
    jquery: "vendor/jquery/dist/jquery",
    "backbone.babysitter": "vendor/backbone.babysitter/lib/backbone.babysitter",
    "backbone.wreqr": "vendor/backbone.wreqr/lib/backbone.wreqr",
    modernizr: "vendor/modernizr/modernizr",
    semantic: "vendor/semantic/dist/semantic",
    text: "vendor/requirejs-text/text",
    marionette: "vendor/backbone.marionette/lib/backbone.marionette",
    requirejs: "vendor/requirejs/require",
    "text": "vendor/requirejs-text/text"
  },
  shim: {
    jquery: {
      exports: "$"
    },
    underscore: {
      exports: "_"
    },
    backbone: {
      deps: [
        "underscore",
        "jquery"
      ],
      exports: "Backbone"
    },
    babysitter: {
      deps: [
        "backbone"
      ]
    },
    wreqr: {
      deps: [
        "backbone"
      ]
    },
    marionette: {
      deps: [
        "backbone.wreqr",
        "backbone.babysitter"
      ],
      exports: "Marionette"
    },
    modernizr: {
      exports: "Modernizr"
    },
    semantic: {
      exports: "Semantic"
    },
    text: {
      exports: "Text"
    }
  },
  packages: [

  ]
});

define([
  "main",
  "jquery",
  "underscore",
  "backbone",
  "marionette",
  "modernizr"
], function (App) {

  "use strict";

  /* App, $, _, Backbone, Marionette, Modernizer within this scope */
  /* require the plugins that depend on the above */
  require([
    "backbone.babysitter",
    "backbone.wreqr",
    "text",
    "semantic"
  ], function () {
    /* plugins ready in this scope */
  });


  require(["main"], function(App) {
    console.log("asdfasdf");
    App.start();
    console.log("2222");
  });
});