<|start_filename|>webpack.config.js<|end_filename|>
const path = require('path')
//const webpack = require('webpack')
//const UglifyJsPlugin = webpack.optimize.UglifyJsPlugin
const env  = require('yargs').argv.env // use --env with webpack 2

const libraryName = 'ZXing'

let outputFile

if (env === 'dist') {
    //plugins.push(new UglifyJsPlugin())
    outputFile = libraryName.toLowerCase() + '.[name].min.js'
} else {
    outputFile = libraryName.toLowerCase() + '.[name].js'
}

const outputDir = path.join(__dirname, 'build-browser')

module.exports = {
    context: __dirname,
    entry: {
        'qrcodereader': './src/browser/BrowserQRCodeReader',
        'qrcodewriter': './src/browser/BrowserQRCodeSvgWriter'
    },
    devtool: 'source-map',
    output: {
        path: outputDir,
        filename: outputFile,
        library: libraryName,
        libraryTarget: 'umd',
        umdNamedDefine: true
    },
    externals: {
        'text-encoding': {
            commonjs: 'text-encoding',
            commonjs2: 'text-encoding',
            amd: 'text-encoding',
            root: 'text-encoding'
        }
    },
    module: {
        rules: [{ 
                enforce: 'pre', 
                test: /\.js$/, 
                loader: 'source-map-loader'
            }, 
            {
                test: /\.ts$/,
                use: [
                    'babel-loader', 
                    'awesome-typescript-loader?configFileName=tsconfig-dist.json',
                ],
                //exclude: /node_modules/
            }]
    },
    resolve: {
        modules: ['node_modules', path.resolve('./src')],
        extensions: ['.ts', '.js']
    }
}

<|start_filename|>package.json<|end_filename|>
{
  "name": "zxing-typescript",
  "version": "0.1.3",
  "description": "TypeScript port of ZXing open-source, multi-format 1D/2D barcode image processing library",
  "keywords": [
    "zxing-typescript",
    "zxing",
    "barcode-scanner",
    "barcode-reader",
    "barcode-generator",
    "qr-code"
  ],
  "main": "build-node/core/MultiFormatReader.js",
  "scripts": {
    "build.node": "tsc",
    "build.browser.dist": "webpack -p --env dist",
    "build.browser.dev": "webpack --env dev --display-error-details",
    "lint": "tslint -c tslint.json 'src/**/*.ts'",
    "pretest-2": "npm run lint && npm run build.node",
    "pretest": "npm run build.node",
    "test": "mocha --compilers js:babel-core/register \"build-node/test/core/**/*.js\" --timeout 30000 --colors",
    "docs": "npm run build.browser.dist && copyfiles -u 1 build-browser/*.min.js docs/examples/",
    "start": "npm run docs && http-server docs",
    "autotransform": "node ./autotransform/transform.js"
  },
  "author": "<NAME>",
  "license": "Apache-2.0",
  "bugs": "https://github.com/aleris/zxing-typescript/issues",
  "repository": {
    "type": "git",
    "url": "https://github.com/aleris/zxing-typescript"
  },
  "dependencies": {
    "@types/big.js": "0.0.31",
    "@types/text-encoding": "0.0.30",
    "big.js": "^3.1.3",
    "text-encoding": "^0.6.4",
    "typescript": "^2.4.2"
  },
  "devDependencies": {
    "@types/async": "^2.0.40",
    "@types/chai": "^4.0.0",
    "@types/jimp": "^0.2.1",
    "@types/mocha": "^2.2.41",
    "@types/node": "^7.0.18",
    "@types/seedrandom": "^2.4.27",
    "@types/sharp": "^0.17.1",
    "async": "^2.4.0",
    "awesome-typescript-loader": "^3.1.3",
    "babel-core": "^6.24.1",
    "babel-loader": "^7.0.0",
    "babel-plugin-add-module-exports": "^0.2.1",
    "babel-preset-es2015": "^6.24.1",
    "copyfiles": "^1.2.0",
    "mocha": "^3.3.0",
    "seedrandom": "^2.4.3",
    "sharp": "^0.17.3",
    "source-map-loader": "^0.2.1",
    "ts-loader": "^2.1.0",
    "tslint": "^5.5.0",
    "typescript": "^2.3.2",
    "uglifyjs-webpack-plugin": "^0.4.3",
    "webpack": "^2.6.1"
  }
}


<|start_filename|>tslint.json<|end_filename|>
{
    "defaultSeverity": "error",
    "extends": [
        "tslint:recommended"
    ],
    "jsRules": {},
    "rules": {
      "semicolon": [true, "never"],
      "quotemark": [true, "single"],
      "no-bitwise": false, /* we use a lot of these */
      "member-ordering": [false] /* to keep the same as with the java version */
    },
    "rulesDirectory": []
}
