]> git.ipfire.org Git - thirdparty/foundation/foundation-sites.git/commitdiff
Very most basic beginnings of using webpack for module bundling
authorKevin Ball <kmball11@gmail.com>
Tue, 10 Jan 2017 22:50:46 +0000 (14:50 -0800)
committerKevin Ball <kmball11@gmail.com>
Tue, 18 Apr 2017 16:41:42 +0000 (09:41 -0700)
js/entries/all.js [new file with mode: 0644]
js/foundation.core.js
package.json
webpack.config.js [new file with mode: 0644]

diff --git a/js/entries/all.js b/js/entries/all.js
new file mode 100644 (file)
index 0000000..918ca70
--- /dev/null
@@ -0,0 +1 @@
+import Foundation from '../foundation.core';
index 3a3fce6ad3c02862edf3813fa7f88d60eab62a6e..db619ccd7bb99b7baf2f9cfd6d00c1aee294dd5a 100644 (file)
@@ -1,7 +1,6 @@
-!function($) {
-
 "use strict";
 
+import $ from 'jquery';
 var FOUNDATION_VERSION = '6.3.1';
 
 // Global Foundation object
@@ -333,4 +332,4 @@ function hyphenate(str) {
   return str.replace(/([a-z])([A-Z])/g, '$1-$2').toLowerCase();
 }
 
-}(jQuery);
+export default Foundation;
index a9f8c78b4c7ced07decdf28324e07e24178988c2..b9005d929656af64cabe32dbfbda9668b482cb36 100644 (file)
@@ -29,6 +29,7 @@
     "array-uniq": "^1.0.2",
     "autoprefixer": "^6.5.3",
     "babel-core": "^6.3.26",
+    "babel-loader": "^6.2.10",
     "babel-plugin-transform-es2015-arrow-functions": "^6.3.13",
     "babel-plugin-transform-es2015-block-scoped-functions": "^6.3.13",
     "babel-plugin-transform-es2015-block-scoping": "^6.4.0",
@@ -92,6 +93,7 @@
     "touch": "^1.0.0",
     "vinyl": "^2.0.1",
     "vinyl-source-stream": "^1.1.0",
+    "webpack": "^2.2.0-rc.3",
     "yargs": "^6.5.0"
   },
   "engines": {
diff --git a/webpack.config.js b/webpack.config.js
new file mode 100644 (file)
index 0000000..b4bc076
--- /dev/null
@@ -0,0 +1,28 @@
+module.exports = {
+  entry: "./js/entries/all.js",
+  output: {
+      path: './_build/assets/js/',
+      filename: "foundation.js"
+  },
+  externals: {
+    jquery: 'jQuery'
+  },
+  module: {
+    loaders: [
+    ],
+    rules: [
+      // JS LOADER
+      // Reference: https://github.com/babel/babel-loader
+      // Transpile .js files using babel-loader
+      // Compiles ES6 and ES7 into ES5 code
+      {
+        test: /\.js$/,
+        use: [
+          {
+            loader: 'babel-loader',
+          }
+        ],
+      }
+    ]
+  }
+};