Commit 5bfc8a31 by Tomas Alabes

webpack umd

parent cca8f941
...@@ -7,21 +7,8 @@ ...@@ -7,21 +7,8 @@
// │ Licensed under the MIT (http://raphaeljs.com/license.html) license.│ \\ // │ Licensed under the MIT (http://raphaeljs.com/license.html) license.│ \\
// └────────────────────────────────────────────────────────────────────┘ \\ // └────────────────────────────────────────────────────────────────────┘ \\
(function (glob, factory) { define(["./raphael.core", "./raphael.svg", "./raphael.vml"], function(R) {
if (typeof define === "function" && define.amd) {
define("raphael", ["raphael.core", "raphael.svg", "raphael.vml"], function(Raphael) {
return (glob.Raphael = factory(Raphael));
});
} else if (typeof exports === "object") {
var raphael = require("raphael.core");
require("raphael.svg"); return R;
require("raphael.vml");
module.exports = factory(raphael); });
} else { \ No newline at end of file
glob.Raphael = factory(glob.Raphael);
}
}(this, function (Raphael) {
return Raphael.ninja();
}));
\ No newline at end of file
...@@ -6,17 +6,8 @@ ...@@ -6,17 +6,8 @@
// │ Licensed under the MIT (http://raphaeljs.com/license.html) license.│ \\ // │ Licensed under the MIT (http://raphaeljs.com/license.html) license.│ \\
// └────────────────────────────────────────────────────────────────────┘ \\ // └────────────────────────────────────────────────────────────────────┘ \\
(function (glob, factory) { define(["eve"], function(eve) {
if (typeof define === "function" && define.amd) {
define("raphael.core", ["eve"], function(eve) {
return factory(eve);
});
} else if (typeof exports === "object") {
module.exports = factory(require("eve"));
} else {
glob.Raphael = factory(glob.eve);
}
}(this, function (eve) {
/*\ /*\
* Raphael * Raphael
[ method ] [ method ]
...@@ -5419,4 +5410,4 @@ ...@@ -5419,4 +5410,4 @@
})(document, "DOMContentLoaded"); })(document, "DOMContentLoaded");
return R; return R;
})); });
...@@ -8,17 +8,7 @@ ...@@ -8,17 +8,7 @@
// │ Licensed under the MIT (http://raphaeljs.com/license.html) license. │ \\ // │ Licensed under the MIT (http://raphaeljs.com/license.html) license. │ \\
// └─────────────────────────────────────────────────────────────────────┘ \\ // └─────────────────────────────────────────────────────────────────────┘ \\
(function (glob, factory) { define(["./raphael.core"], function(R) {
if (typeof define === "function" && define.amd) {
define("raphael.svg", ["raphael.core"], function(raphael) {
return factory(raphael);
});
} else if (typeof exports === "object") {
factory(require("./raphael.core"));
} else {
factory(glob.Raphael);
}
}(this, function(R) {
if (R && !R.svg) { if (R && !R.svg) {
return; return;
} }
...@@ -1435,4 +1425,4 @@ ...@@ -1435,4 +1425,4 @@
}; };
})(method); })(method);
} }
})); });
...@@ -8,17 +8,7 @@ ...@@ -8,17 +8,7 @@
// │ Licensed under the MIT (http://raphaeljs.com/license.html) license. │ \\ // │ Licensed under the MIT (http://raphaeljs.com/license.html) license. │ \\
// └─────────────────────────────────────────────────────────────────────┘ \\ // └─────────────────────────────────────────────────────────────────────┘ \\
(function (glob, factory) { define(["./raphael.core"], function(R) {
if (typeof define === "function" && define.amd) {
define("raphael.vml", ["raphael.core"], function(raphael) {
return factory(raphael);
});
} else if (typeof exports === "object") {
factory(require("./raphael.core"));
} else {
factory(glob.Raphael);
}
}(this, function(R) {
if (R && !R.vml) { if (R && !R.vml) {
return; return;
} }
...@@ -1017,4 +1007,4 @@ ...@@ -1017,4 +1007,4 @@
}; };
})(method); })(method);
} }
})); });
...@@ -9,24 +9,27 @@ ...@@ -9,24 +9,27 @@
<!-- Global use --> <!-- Global use -->
<!-- To work with full version --> <!-- To work with full version -->
<!--<script type="text/javascript" src="../raphael.js"></script>--> <script type="text/javascript" src="../bower_components/requirejs/require.js"></script>
<script type="text/javascript" src="../raphael-wp.js"></script>
<!-- To work with minified version --> <!-- To work with minified version -->
<!--<script type="text/javascript" src="../raphael-min.js"></script>--> <!--<script type="text/javascript" src="../raphael-min.js"></script>-->
<!-- Comment this script tag if you are testing with AMD --> <!-- Comment this script tag if you are testing with AMD -->
<!--<script type="text/javascript"> <script type="text/javascript">
// Initialize container when document is loaded // Initialize container when document is loaded
window.onload = function () { window.onload = function () {
var paper = Raphael(0, 0, 640, 720, "container"); require(['Raphael'], function(Raphael) {
paper.circle(100, 100, 100).attr({'fill':'270-#FAE56B:0-#E56B6B:100'}); //example var paper = Raphael(0, 0, 640, 720, "container");
paper.circle(100, 100, 100).attr({'fill':'270-#FAE56B:0-#E56B6B:100'}); //example
});
}; };
//Work here, in a separate script file or via command line //Work here, in a separate script file or via command line
</script>--> </script>
<!-- Use amdDev.js to work with AMD and Raphael --> <!-- Use amdDev.js to work with AMD and Raphael -->
<!-- You need to do a 'bower install -D' first to get requirejs --> <!-- You need to do a 'bower install -D' first to get requirejs -->
<script data-main="amdDev" src="../bower_components/requirejs/require.js"></script>
</head> </head>
<body> <body>
......
This source diff could not be displayed because it is too large. You can view the blob instead.
var webpack = require("webpack");
module.exports = {
entry: './dev/raphael.amd.js',
output: {
filename: "raphael-wp.js",
libraryTarget: "umd",
library: "Raphael",
umdNamedDefine: true
},
target: "web",
externals: [
],
loaders: [
],
plugins: [
],
resolveLoader: {
},
resolve: {
modulesDirectories: ["bower_components"]
}
};
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment