mirror of
https://github.com/serratus/quaggaJS.git
synced 2026-08-12 21:21:42 +08:00
Updated Readme and webpack-config
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
quaggaJS
|
quaggaJS
|
||||||
========
|
========
|
||||||
|
|
||||||
- [Changelog](#changelog) (2015-09-15)
|
- [Changelog](#changelog) (2015-10-13)
|
||||||
|
|
||||||
## What is QuaggaJS?
|
## What is QuaggaJS?
|
||||||
|
|
||||||
@@ -90,11 +90,15 @@ You can build the library yourself by simply cloning the repo and typing:
|
|||||||
|
|
||||||
```console
|
```console
|
||||||
> npm install
|
> 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.
|
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
|
## API
|
||||||
|
|
||||||
@@ -360,7 +364,7 @@ automatically generated in the coverage/ folder.
|
|||||||
|
|
||||||
```console
|
```console
|
||||||
> npm install
|
> npm install
|
||||||
> grunt test
|
> npm run test
|
||||||
```
|
```
|
||||||
## Image Debugging
|
## Image Debugging
|
||||||
|
|
||||||
@@ -430,6 +434,13 @@ on the ``singleChannel`` flag in the configuration when using ``decodeSingle``.
|
|||||||
|
|
||||||
## <a name="changelog">Changelog</a>
|
## <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
|
### 2015-09-15
|
||||||
Take a look at the release-notes ([0.7.0]
|
Take a look at the release-notes ([0.7.0]
|
||||||
(https://github.com/serratus/quaggaJS/releases/tag/v0.7.0))
|
(https://github.com/serratus/quaggaJS/releases/tag/v0.7.0))
|
||||||
|
|||||||
Vendored
-1
File diff suppressed because one or more lines are too long
@@ -1,3 +1,5 @@
|
|||||||
|
var path = require('path');
|
||||||
|
|
||||||
module.exports = function(config) {
|
module.exports = function(config) {
|
||||||
config.set({
|
config.set({
|
||||||
basePath: '',
|
basePath: '',
|
||||||
@@ -21,6 +23,13 @@ module.exports = function(config) {
|
|||||||
loader: 'babel'
|
loader: 'babel'
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
},
|
||||||
|
resolve: {
|
||||||
|
extensions: ['', '.js', '.jsx'],
|
||||||
|
alias: {
|
||||||
|
'input_stream$': path.resolve(__dirname, 'src/input_stream'),
|
||||||
|
'frame_grabber$': path.resolve(__dirname, 'src/frame_grabber')
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
plugins: [
|
plugins: [
|
||||||
|
|||||||
+8
-1
@@ -30,7 +30,14 @@ module.exports = function(config) {
|
|||||||
loader: 'isparta'
|
loader: 'isparta'
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
},
|
||||||
|
resolve: {
|
||||||
|
extensions: ['', '.js', '.jsx'],
|
||||||
|
alias: {
|
||||||
|
'input_stream$': path.resolve(__dirname, 'src/input_stream'),
|
||||||
|
'frame_grabber$': path.resolve(__dirname, 'src/frame_grabber')
|
||||||
|
}
|
||||||
|
},
|
||||||
},
|
},
|
||||||
plugins: [
|
plugins: [
|
||||||
'karma-chrome-launcher',
|
'karma-chrome-launcher',
|
||||||
|
|||||||
+5
-3
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "quagga",
|
"name": "quagga",
|
||||||
"version": "0.7.0",
|
"version": "0.8.0",
|
||||||
"description": "An advanced barcode-scanner written in JavaScript",
|
"description": "An advanced barcode-scanner written in JavaScript",
|
||||||
"main": "lib/quagga.js",
|
"main": "lib/quagga.js",
|
||||||
"browser": "dist/quagga.min.js",
|
"browser": "dist/quagga.min.js",
|
||||||
@@ -38,8 +38,10 @@
|
|||||||
"doc": "doc"
|
"doc": "doc"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"test": "karma start",
|
"test": "grunt test",
|
||||||
"build": "webpack && webpack --config webpack.config.min.js && grunt uglyasm"
|
"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": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
|
|||||||
@@ -3,13 +3,11 @@ var OriginalSource = require("webpack-core/lib/OriginalSource");
|
|||||||
|
|
||||||
function MyUmdPlugin(options) {
|
function MyUmdPlugin(options) {
|
||||||
this.name = options.library;
|
this.name = options.library;
|
||||||
console.log(this.name);
|
|
||||||
}
|
}
|
||||||
module.exports = MyUmdPlugin;
|
module.exports = MyUmdPlugin;
|
||||||
MyUmdPlugin.prototype.apply = function(compiler) {
|
MyUmdPlugin.prototype.apply = function(compiler) {
|
||||||
compiler.plugin("this-compilation", function(compilation) {
|
compiler.plugin("this-compilation", function(compilation) {
|
||||||
var mainTemplate = compilation.mainTemplate;
|
var mainTemplate = compilation.mainTemplate;
|
||||||
console.log("Compilation: " + (typeof compilation.templatesPlugin));
|
|
||||||
compilation.templatesPlugin("render-with-entry", function(source, chunk, hash) {
|
compilation.templatesPlugin("render-with-entry", function(source, chunk, hash) {
|
||||||
|
|
||||||
var amdFactory = "factory";
|
var amdFactory = "factory";
|
||||||
|
|||||||
Vendored
+3
@@ -6,3 +6,6 @@ module.exports.plugins.unshift(
|
|||||||
);
|
);
|
||||||
|
|
||||||
module.exports.output.filename = 'quagga.min.js';
|
module.exports.output.filename = 'quagga.min.js';
|
||||||
|
|
||||||
|
module.exports.output.sourceMapFilename = null;
|
||||||
|
module.exports.devtool = null;
|
||||||
|
|||||||
@@ -3,8 +3,6 @@ var webpack = require('webpack'),
|
|||||||
|
|
||||||
module.exports = require('./webpack.config.js');
|
module.exports = require('./webpack.config.js');
|
||||||
|
|
||||||
console.log(path.resolve(__dirname, 'lib/input_stream'));
|
|
||||||
|
|
||||||
module.exports.resolve = {
|
module.exports.resolve = {
|
||||||
extensions: ['', '.js', '.jsx'],
|
extensions: ['', '.js', '.jsx'],
|
||||||
alias: {
|
alias: {
|
||||||
|
|||||||
Reference in New Issue
Block a user