From: eric thul Date: Sat, 26 Dec 2015 00:16:21 +0000 (-0500) Subject: Updating example X-Git-Tag: 0.5.0~1^2~3 X-Git-Url: https://git.immae.eu/?a=commitdiff_plain;h=9764d2a7d5e6d9cf081dcbc162dac01f95d452b3;p=github%2Ffretlink%2Fpurs-loader.git Updating example --- diff --git a/example/package.json b/example/package.json index d1319b1..5f7ee63 100644 --- a/example/package.json +++ b/example/package.json @@ -3,15 +3,16 @@ "version": "0.0.0", "private": true, "scripts": { - "build": "mkdir -p output && ./node_modules/.bin/webpack --progress --colors", - "build:watch": "mkdir -p output && ./node_modules/.bin/webpack --progress --colors --watch", + "build": "webpack --progress --colors --bail", + "build:watch": "webpack --progress --colors --watch", "run": "node bundle.js", "clean": "rm -rf bower_components && rm -rf bundle.js && rm -rf node_modules && rm -rf output" }, "license": "MIT", "devDependencies": { "node-libs-browser": "^0.5.2", + "purescript-webpack-plugin": "^0.1.0", "purs-loader": "file:../", - "webpack": "^1.10.1" + "webpack": "^1.12.9" } } 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 @@ -module Foo (foo) where +module Foo where import Prelude import qualified Foo.Bar as B -foo = "b" +foo = "A" -foo' = "c" +bar = "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 @@ -module Test (test, testing) where +module Test (testing) where -import Prelude +bar = "c" -test = "a" +goo = "a" foreign import testing :: String diff --git a/example/src/entry.js b/example/src/entry.js index cde8507..be0a475 100644 --- a/example/src/entry.js +++ b/example/src/entry.js @@ -1,4 +1,4 @@ -var Prelude = require('Prelude'); +var Prelude = require('purescript-prelude/src/Prelude.purs'); var test = require('./Test.purs'); diff --git a/example/webpack.config.js b/example/webpack.config.js index f1456d5..7f468c8 100644 --- a/example/webpack.config.js +++ b/example/webpack.config.js @@ -1,14 +1,14 @@ -var path = require('path'); +'use strict'; -var srcs = ['src[]=bower_components/purescript-*/src/**/*.purs', 'src[]=src/**/*.purs']; +var PurescriptWebpackPlugin = require('purescript-webpack-plugin'); -var ffis = ['ffi[]=bower_components/purescript-*/src/**/*.js', 'ffi[]=src/**/*FFI.js']; +var src = ['bower_components/purescript-*/src/**/*.purs', 'src/**/*.purs']; -var output = 'output'; +var ffi = ['bower_components/purescript-*/src/**/*.js', 'src/**/*FFI.js']; var modulesDirectories = [ 'node_modules', - 'bower_components/purescript-prelude/src' + 'bower_components' ]; var config @@ -18,12 +18,10 @@ var config , filename: 'bundle.js' } , module: { loaders: [ { test: /\.purs$/ - , loader: 'purs-loader?output=' + output + '&' + srcs.concat(ffis).join('&') + , loader: 'purs-loader' } ] } - , resolve: { modulesDirectories: modulesDirectories - , extensions: ['', '.js'] - } - , resolveLoader: { root: path.join(__dirname, 'node_modules') } + , resolve: { modulesDirectories: modulesDirectories } + , plugins: [ new PurescriptWebpackPlugin({src: src, ffi: ffi}) ] } ; diff --git a/package.json b/package.json index 3bcd03f..13d4c6c 100644 --- a/package.json +++ b/package.json @@ -26,7 +26,6 @@ "dependencies": { "async": "^1.3.0", "chalk": "^1.1.0", - "glob": "^5.0.3", "loader-utils": "^0.2.6" } }