Skip to content

Commit

Permalink
Updated Readme and webpack-config
Browse files Browse the repository at this point in the history
  • Loading branch information
serratus committed Oct 14, 2015
1 parent 6a56d7a commit 0e917e4
Show file tree
Hide file tree
Showing 8 changed files with 43 additions and 16 deletions.
23 changes: 17 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
quaggaJS
========

- [Changelog](#changelog) (2015-09-15)
- [Changelog](#changelog) (2015-10-13)

## What is QuaggaJS?

Expand Down Expand Up @@ -34,9 +34,9 @@ be aligned with the viewport.

In order to take full advantage of quaggaJS, the browser needs to support the
`getUserMedia` API which is already implemented in recent versions of Firefox,
Chrome, IE (Edge) and Opera. The API is also available on their mobile
Chrome, IE (Edge) and Opera. The API is also available on their mobile
counterparts installed on Android (except IE). Safari does not allow the access
to the camera yet, neither on desktop, nor on mobile. You can check
to the camera yet, neither on desktop, nor on mobile. You can check
[caniuse][caniuse_getusermedia] for updates.

In cases where real-time decoding is not needed, or the platform does not
Expand Down Expand Up @@ -90,11 +90,15 @@ You can build the library yourself by simply cloning the repo and typing:

```console
> npm install
> grunt dist
> npm run build
```

This grunt task builds a non optimized version `quagga.js` and a minified
This npm script builds a non optimized version `quagga.js` and a minified
version `quagga.min.js` and places both files in the `dist` folder.
Additionally, a `quagga.map` source-map is placed alongside these files. This
file is only valid for the non-uglified version `quagga.js` because the
minified version is altered after compression and does not align with the map
file any more.

## API

Expand Down Expand Up @@ -360,7 +364,7 @@ automatically generated in the coverage/ folder.

```console
> npm install
> grunt test
> npm run test
```
## Image Debugging

Expand Down Expand Up @@ -430,6 +434,13 @@ on the ``singleChannel`` flag in the configuration when using ``decodeSingle``.

## <a name="changelog">Changelog</a>

### 2015-10-13
Take a look at the release-notes ([0.8.0]
(https://github.com/serratus/quaggaJS/releases/tag/v0.8.0))

- Improvements
- Replaced RequireJS with webpack

### 2015-09-15
Take a look at the release-notes ([0.7.0]
(https://github.com/serratus/quaggaJS/releases/tag/v0.7.0))
Expand Down
3 changes: 1 addition & 2 deletions dist/quagga.min.js

Large diffs are not rendered by default.

9 changes: 9 additions & 0 deletions karma-integration.conf.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
var path = require('path');

module.exports = function(config) {
config.set({
basePath: '',
Expand All @@ -21,6 +23,13 @@ module.exports = function(config) {
loader: 'babel'
}
]
},
resolve: {
extensions: ['', '.js', '.jsx'],
alias: {
'input_stream$': path.resolve(__dirname, 'src/input_stream'),
'frame_grabber$': path.resolve(__dirname, 'src/frame_grabber')
}
}
},
plugins: [
Expand Down
9 changes: 8 additions & 1 deletion karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,14 @@ module.exports = function(config) {
loader: 'isparta'
}
]
}
},
resolve: {
extensions: ['', '.js', '.jsx'],
alias: {
'input_stream$': path.resolve(__dirname, 'src/input_stream'),
'frame_grabber$': path.resolve(__dirname, 'src/frame_grabber')
}
},
},
plugins: [
'karma-chrome-launcher',
Expand Down
8 changes: 5 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "quagga",
"version": "0.7.0",
"version": "0.8.0",
"description": "An advanced barcode-scanner written in JavaScript",
"main": "lib/quagga.js",
"browser": "dist/quagga.min.js",
Expand Down Expand Up @@ -38,8 +38,10 @@
"doc": "doc"
},
"scripts": {
"test": "karma start",
"build": "webpack && webpack --config webpack.config.min.js && grunt uglyasm"
"test": "grunt test",
"integrationtest": "grunt integrationtest",
"build": "webpack && webpack --config webpack.config.min.js && grunt uglyasm && webpack --config webpack.node.config.js",
"dev-server": "webpack-dev-server"
},
"repository": {
"type": "git",
Expand Down
2 changes: 0 additions & 2 deletions plugins/umd.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,11 @@ var OriginalSource = require("webpack-core/lib/OriginalSource");

function MyUmdPlugin(options) {
this.name = options.library;
console.log(this.name);
}
module.exports = MyUmdPlugin;
MyUmdPlugin.prototype.apply = function(compiler) {
compiler.plugin("this-compilation", function(compilation) {
var mainTemplate = compilation.mainTemplate;
console.log("Compilation: " + (typeof compilation.templatesPlugin));
compilation.templatesPlugin("render-with-entry", function(source, chunk, hash) {

var amdFactory = "factory";
Expand Down
3 changes: 3 additions & 0 deletions webpack.config.min.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,6 @@ module.exports.plugins.unshift(
);

module.exports.output.filename = 'quagga.min.js';

module.exports.output.sourceMapFilename = null;
module.exports.devtool = null;
2 changes: 0 additions & 2 deletions webpack.node.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ var webpack = require('webpack'),

module.exports = require('./webpack.config.js');

console.log(path.resolve(__dirname, 'lib/input_stream'));

module.exports.resolve = {
extensions: ['', '.js', '.jsx'],
alias: {
Expand Down

0 comments on commit 0e917e4

Please sign in to comment.