Completed
Pull Request — master (#90)
by Janis
15:10
created

js/webpack.config.js   A

Complexity

Total Complexity 0
Complexity/F 0

Size

Lines of Code 68
Function Count 0

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
wmc 0
dl 0
loc 68
rs 10
c 0
b 0
f 0
cc 0
nc 1
mnd 0
bc 0
fnc 0
bpm 0
cpm 0
noi 3
1
var path = require('path');
2
3
module.exports = {
4
    entry: {
5
        app: __dirname + '/src/app.ts',
0 ignored issues
show
Compatibility introduced by
Consider using the path module for constructing paths since they are otherwise not cross-OS compatible.
Loading history...
6
        personal: __dirname + '/src/personal.ts'
0 ignored issues
show
Compatibility introduced by
Consider using the path module for constructing paths since they are otherwise not cross-OS compatible.
Loading history...
7
    },
8
    output: {
9
        path: __dirname + '/dist',
0 ignored issues
show
Compatibility introduced by
Consider using the path module for constructing paths since they are otherwise not cross-OS compatible.
Loading history...
10
        filename: 'ocr[name].js',
11
        library: ['OCA', 'Ocr'],
12
        libraryTarget: 'umd',
13
    },
14
    module: {
15
        preLoaders: [
16
            {
17
                test: /\.ts$/,
18
                loader: 'tslint-loader'
19
            }
20
        ],
21
        loaders: [
22
            {
23
                test: /\.hbs$/,
24
                loader: "handlebars-loader?runtime=handlebars/runtime"
25
            },
26
            {
27
                test: /\.ts?$/,
28
                loader: 'ts',
29
            }
30
        ]
31
    },
32
    tslint: {
33
        tsConfigFile: 'tsconfig.app.json'
34
    },
35
    ts: {
36
        configFileName: 'tsconfig.app.json'
37
    },
38
    resolve: {
39
        modules: [path.resolve('./src')],
40
        extensions: ['', '.ts']
41
    },
42
    externals: [
43
        {
44
            underscore: { // UMD
45
                commonjs: 'underscore',
46
                commonjs2: 'underscore',
47
                amd: 'underscore',
48
                root: '_'
49
            }
50
        },
51
        {
52
            jquery: { // UMD
53
                commonjs: 'jQuery',
54
                commonjs2: 'jQuery',
55
                amd: 'jQuery',
56
                root: '$'
57
            }
58
        },
59
        {
60
            'handlebars/runtime': {
61
                root: 'Handlebars',
62
                amd: 'handlebars/runtime',
63
                commonjs2: 'handlebars/runtime',
64
                commonjs: 'handlebars/runtime'
65
            }
66
        }
67
    ]
68
};
69