aboutsummaryrefslogtreecommitdiffhomepage
path: root/example
diff options
context:
space:
mode:
Diffstat (limited to 'example')
-rw-r--r--example/README.md2
-rw-r--r--example/bower.json2
-rw-r--r--example/package.json2
-rw-r--r--example/src/Foo.purs5
-rw-r--r--example/src/Foo/Bar.purs2
-rw-r--r--example/src/Test.purs2
-rw-r--r--example/src/entry.js6
-rw-r--r--example/webpack.config.js21
8 files changed, 32 insertions, 10 deletions
diff --git a/example/README.md b/example/README.md
index 87b9bc7..bac4f6c 100644
--- a/example/README.md
+++ b/example/README.md
@@ -1,6 +1,6 @@
1```bash 1```bash
2bower install 2bower install
3npm install 3npm install
4npm run-script webpack 4npm run-script build
5npm run-script run 5npm run-script run
6``` 6```
diff --git a/example/bower.json b/example/bower.json
index b4a1c78..c83e735 100644
--- a/example/bower.json
+++ b/example/bower.json
@@ -2,6 +2,6 @@
2 "name": "example", 2 "name": "example",
3 "private": true, 3 "private": true,
4 "devDependencies": { 4 "devDependencies": {
5 "purescript-maybe": "~0.2.1" 5 "purescript-prelude": "~0.1.0"
6 } 6 }
7} 7}
diff --git a/example/package.json b/example/package.json
index 915eb27..df3e74f 100644
--- a/example/package.json
+++ b/example/package.json
@@ -3,7 +3,7 @@
3 "version": "0.0.0", 3 "version": "0.0.0",
4 "private": true, 4 "private": true,
5 "scripts": { 5 "scripts": {
6 "webpack": "./node_modules/.bin/webpack", 6 "build": "mkdir -p output && ./node_modules/.bin/webpack",
7 "run": "node bundle.js", 7 "run": "node bundle.js",
8 "clean": "rm -rf bower_components && rm -rf bundle.js && rm -rf node_modules && rm -rf output" 8 "clean": "rm -rf bower_components && rm -rf bundle.js && rm -rf node_modules && rm -rf output"
9 }, 9 },
diff --git a/example/src/Foo.purs b/example/src/Foo.purs
index 3e3a04c..b234e0d 100644
--- a/example/src/Foo.purs
+++ b/example/src/Foo.purs
@@ -1,6 +1,9 @@
1module Foo (foo) where 1module Foo (foo) where
2 2
3import Data.Maybe 3import Prelude
4
4import qualified Foo.Bar as B 5import qualified Foo.Bar as B
5 6
6foo = "b" 7foo = "b"
8
9foo' = "c"
diff --git a/example/src/Foo/Bar.purs b/example/src/Foo/Bar.purs
index 4ae100d..6932902 100644
--- a/example/src/Foo/Bar.purs
+++ b/example/src/Foo/Bar.purs
@@ -1,3 +1,5 @@
1module Foo.Bar (bar) where 1module Foo.Bar (bar) where
2 2
3bar = "c" 3bar = "c"
4
5bar' = "d"
diff --git a/example/src/Test.purs b/example/src/Test.purs
index 8a5cb88..d9f1b96 100644
--- a/example/src/Test.purs
+++ b/example/src/Test.purs
@@ -1,5 +1,5 @@
1module Test (test) where 1module Test (test) where
2 2
3import Data.Maybe 3import Prelude
4 4
5test = "a" 5test = "a"
diff --git a/example/src/entry.js b/example/src/entry.js
index cc09034..344d4c6 100644
--- a/example/src/entry.js
+++ b/example/src/entry.js
@@ -1,7 +1,11 @@
1var Prelude = require('Prelude');
2
1var test = require('./Test'); 3var test = require('./Test');
2 4
3var foo = require('./Foo'); 5var foo = require('./Foo');
4 6
5var baz = require('./Foo/Baz'); 7var baz = require('./Foo/Baz');
6 8
7console.log(test, foo, baz); 9var bar = require('./Foo/Bar');
10
11console.log(Prelude, test, foo, baz, bar);
diff --git a/example/webpack.config.js b/example/webpack.config.js
index f67e83a..9294904 100644
--- a/example/webpack.config.js
+++ b/example/webpack.config.js
@@ -1,14 +1,27 @@
1var path = require('path'); 1var path = require('path');
2 2
3var srcs = ['src[]=bower_components/purescript-*/src/**/*.purs', 'src[]=src/**/*.purs'];
4
5var ffis = ['ffi[]=bower_components/purescript-*/src/**/*.js'];
6
7var output = 'output';
8
9var modulesDirectories = [
10 'node_modules',
11 'bower_components/purescript-prelude/src',
12 output
13];
14
3var config 15var config
4 = { entry: './src/entry' 16 = { entry: './src/entry'
5 , output: { path: __dirname 17 , output: { path: __dirname
18 , pathinfo: true
6 , filename: 'bundle.js' 19 , filename: 'bundle.js'
7 } 20 }
8 , module: { loaders: [ { test: /\.purs$/, loader: 'purs-loader?src[]=src' } ] } 21 , module: { loaders: [ { test: /\.purs$/
9 , resolve: { modulesDirectories: [ 'node_modules', 22 , loader: 'purs-loader?output=' + output + '&' + srcs.concat(ffis).join('&')
10 'output' 23 } ] }
11 ] 24 , resolve: { modulesDirectories: modulesDirectories
12 , extensions: ['', '.js', '.purs'] 25 , extensions: ['', '.js', '.purs']
13 } 26 }
14 , resolveLoader: { root: path.join(__dirname, 'node_modules') } 27 , resolveLoader: { root: path.join(__dirname, 'node_modules') }