aboutsummaryrefslogtreecommitdiffhomepage
path: root/example
diff options
context:
space:
mode:
Diffstat (limited to 'example')
-rw-r--r--example/package.json7
-rw-r--r--example/src/Bar.purs3
-rw-r--r--example/src/Foo.purs6
-rw-r--r--example/src/Test.purs6
-rw-r--r--example/src/entry.js10
-rw-r--r--example/src/jam.js5
-rw-r--r--example/webpack.config.js18
7 files changed, 32 insertions, 23 deletions
diff --git a/example/package.json b/example/package.json
index d1319b1..e256de8 100644
--- a/example/package.json
+++ b/example/package.json
@@ -3,15 +3,16 @@
3 "version": "0.0.0", 3 "version": "0.0.0",
4 "private": true, 4 "private": true,
5 "scripts": { 5 "scripts": {
6 "build": "mkdir -p output && ./node_modules/.bin/webpack --progress --colors", 6 "build": "webpack --progress --colors --bail",
7 "build:watch": "mkdir -p output && ./node_modules/.bin/webpack --progress --colors --watch", 7 "build:watch": "webpack --progress --colors --watch",
8 "run": "node bundle.js", 8 "run": "node bundle.js",
9 "clean": "rm -rf bower_components && rm -rf bundle.js && rm -rf node_modules && rm -rf output" 9 "clean": "rm -rf bower_components && rm -rf bundle.js && rm -rf node_modules && rm -rf output"
10 }, 10 },
11 "license": "MIT", 11 "license": "MIT",
12 "devDependencies": { 12 "devDependencies": {
13 "node-libs-browser": "^0.5.2", 13 "node-libs-browser": "^0.5.2",
14 "purescript-webpack-plugin": "^0.1.1",
14 "purs-loader": "file:../", 15 "purs-loader": "file:../",
15 "webpack": "^1.10.1" 16 "webpack": "^1.12.9"
16 } 17 }
17} 18}
diff --git a/example/src/Bar.purs b/example/src/Bar.purs
new file mode 100644
index 0000000..a37171f
--- /dev/null
+++ b/example/src/Bar.purs
@@ -0,0 +1,3 @@
1module Bar where
2
3test = "b"
diff --git a/example/src/Foo.purs b/example/src/Foo.purs
index b234e0d..97b7cec 100644
--- a/example/src/Foo.purs
+++ b/example/src/Foo.purs
@@ -1,9 +1,9 @@
1module Foo (foo) where 1module Foo where
2 2
3import Prelude 3import Prelude
4 4
5import qualified Foo.Bar as B 5import qualified Foo.Bar as B
6 6
7foo = "b" 7foo = "A"
8 8
9foo' = "c" 9bar = "B"
diff --git a/example/src/Test.purs b/example/src/Test.purs
index 133a192..3a92681 100644
--- a/example/src/Test.purs
+++ b/example/src/Test.purs
@@ -1,7 +1,7 @@
1module Test (test, testing) where 1module Test (testing) where
2 2
3import Prelude 3bar = "c"
4 4
5test = "a" 5goo = "a"
6 6
7foreign import testing :: String 7foreign import testing :: String
diff --git a/example/src/entry.js b/example/src/entry.js
index cde8507..a1e2a99 100644
--- a/example/src/entry.js
+++ b/example/src/entry.js
@@ -1,9 +1,11 @@
1var Prelude = require('Prelude'); 1var Prelude = require('purescript-prelude/src/Prelude');
2 2
3var test = require('./Test.purs'); 3var test = require('./Test');
4 4
5var foo = require('./Foo.purs'); 5var foo = require('./Foo.purs');
6 6
7var baz = require('./Foo/Baz.purs'); 7var baz = require('./Foo/Baz');
8 8
9console.log(Prelude, test, foo, baz); 9var jam = require('./jam');
10
11console.log(Prelude, test, foo, baz, jam);
diff --git a/example/src/jam.js b/example/src/jam.js
new file mode 100644
index 0000000..8889a69
--- /dev/null
+++ b/example/src/jam.js
@@ -0,0 +1,5 @@
1var x = 'a';
2
3var abcde = require('./Bar');
4
5module.exports = abcde;
diff --git a/example/webpack.config.js b/example/webpack.config.js
index f1456d5..602de84 100644
--- a/example/webpack.config.js
+++ b/example/webpack.config.js
@@ -1,14 +1,14 @@
1var path = require('path'); 1'use strict';
2 2
3var srcs = ['src[]=bower_components/purescript-*/src/**/*.purs', 'src[]=src/**/*.purs']; 3var PurescriptWebpackPlugin = require('purescript-webpack-plugin');
4 4
5var ffis = ['ffi[]=bower_components/purescript-*/src/**/*.js', 'ffi[]=src/**/*FFI.js']; 5var src = ['bower_components/purescript-*/src/**/*.purs', 'src/**/*.purs'];
6 6
7var output = 'output'; 7var ffi = ['bower_components/purescript-*/src/**/*.js', 'src/**/*FFI.js'];
8 8
9var modulesDirectories = [ 9var modulesDirectories = [
10 'node_modules', 10 'node_modules',
11 'bower_components/purescript-prelude/src' 11 'bower_components'
12]; 12];
13 13
14var config 14var config
@@ -18,12 +18,10 @@ var config
18 , filename: 'bundle.js' 18 , filename: 'bundle.js'
19 } 19 }
20 , module: { loaders: [ { test: /\.purs$/ 20 , module: { loaders: [ { test: /\.purs$/
21 , loader: 'purs-loader?output=' + output + '&' + srcs.concat(ffis).join('&') 21 , loader: 'purs-loader'
22 } ] } 22 } ] }
23 , resolve: { modulesDirectories: modulesDirectories 23 , resolve: { modulesDirectories: modulesDirectories, extensions: [ '', '.js', '.purs'] }
24 , extensions: ['', '.js'] 24 , plugins: [ new PurescriptWebpackPlugin({src: src, ffi: ffi}) ]
25 }
26 , resolveLoader: { root: path.join(__dirname, 'node_modules') }
27 } 25 }
28 ; 26 ;
29 27