]> git.immae.eu Git - github/fretlink/purs-loader.git/commitdiff
Updating example for .purs extension
authoreric thul <thul.eric@gmail.com>
Tue, 29 Dec 2015 13:24:06 +0000 (08:24 -0500)
committereric thul <thul.eric@gmail.com>
Tue, 29 Dec 2015 13:24:06 +0000 (08:24 -0500)
Showing usage of specifying .purs and not specifying an extension for
require statements.

example/package.json
example/src/entry.js
example/src/jam.js [moved from example/src/bar.js with 52% similarity]
example/webpack.config.js

index 5f7ee631b49e5122e213b614d62ab6ca431cffb4..e256de8d4e40e54f487362a9589e1909f4741620 100644 (file)
@@ -11,7 +11,7 @@
   "license": "MIT",
   "devDependencies": {
     "node-libs-browser": "^0.5.2",
-    "purescript-webpack-plugin": "^0.1.0",
+    "purescript-webpack-plugin": "^0.1.1",
     "purs-loader": "file:../",
     "webpack": "^1.12.9"
   }
index 57808c292000994c3fcfdd264485fbcc91fca49a..a1e2a993747e168b641202c675b12bcb49989ef8 100644 (file)
@@ -1,11 +1,11 @@
-var Prelude = require('purescript-prelude/src/Prelude.purs');
+var Prelude = require('purescript-prelude/src/Prelude');
 
-var test = require('./Test.purs');
+var test = require('./Test');
 
 var foo = require('./Foo.purs');
 
-var baz = require('./Foo/Baz.purs');
+var baz = require('./Foo/Baz');
 
-var bar = require('./bar');
+var jam = require('./jam');
 
-console.log(Prelude, test, foo, baz, bar);
+console.log(Prelude, test, foo, baz, jam);
similarity index 52%
rename from example/src/bar.js
rename to example/src/jam.js
index 8c3bb913dd5fee15c1b3190e46d5f977211f3753..8889a69839393bb41be4fbd3456df4c45259c0de 100644 (file)
@@ -1,5 +1,5 @@
 var x = 'a';
 
-var abcde = require('./Bar.purs');
+var abcde = require('./Bar');
 
 module.exports = abcde;
index 7f468c8323084d854a22b8c98903b72033fe10a2..602de8483fe63794b82d8696f905096bfccb6357 100644 (file)
@@ -20,7 +20,7 @@ var config
     , module: { loaders: [ { test: /\.purs$/
                            , loader: 'purs-loader'
                            } ] }
-    , resolve: { modulesDirectories: modulesDirectories }
+    , resolve: { modulesDirectories: modulesDirectories, extensions: [ '', '.js', '.purs'] }
     , plugins: [ new PurescriptWebpackPlugin({src: src, ffi: ffi}) ]
     }
     ;